From abe0593395c6e4074a743f78cceea1248f4bf81b Mon Sep 17 00:00:00 2001 From: Jeff Dairiki Date: Tue, 22 Feb 2022 17:04:31 -0800 Subject: [PATCH] Deploy to https://lektor.github.io/lektor-website/ Disuse tox for running the deployment. By default tox filters most environment variables out when running testenvs. This filters any credentials (e.g. LEKTOR_DEPLOY_PASSWORD) from the environment. Those environment variables could be passed to the testenv, but it seems simpler to build and deploy straight from the workflow. --- .github/workflows/deploy.yml | 23 +++++++---------------- Website.lektorproject | 17 +++++++++-------- tox.ini | 6 ------ 3 files changed, 16 insertions(+), 30 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2e7ea6ee..217e86ca 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -20,27 +20,18 @@ jobs: DEPLOY: ${{ github.event_name != 'pull_request' }} steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/setup-python@v2 - - name: Install tox + - name: Install Lektor run: | python -m pip install --upgrade pip setuptools - python -m pip install tox + python -m pip install lektor - - run: echo DEPLOY='${{ env.DEPLOY }}' - - name: Run tox to build site - if: env.DEPLOY != 'true' - run: tox + - run: lektor build - - name: Add flow.srv.pocoo.org to ~/.ssh/known_hosts - if: env.DEPLOY == 'true' - run: | - mkdir -p ~/.ssh/ - echo "flow.srv.pocoo.org ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC8X1nZnXChssjRoUMXWwz3IskVFaGvD9sRIMvlkU8RbLMqfp0kT+/hhi/c1xVv+wdGCrPTuFSs9X2RzdNsWSwaUqoeSh80BsfQRso3hSPd2Z+PNplHGuBt/29MwX2l+j1lWB7D2VFb7R1HGxwgmccef75JepVse7fCjVP3KvjIJ4nae0k9aHhcKLVUlRl+Ut+8pWCGE1wdoMEwpeio8DeBX7YWE1vX5DhAd0U+nga2xRAuWbQ5sD1LJQ1fmZoTBUKsVioQmuvrUQKSofwolwBgQtDqgcWLyeKfWn11aG6rMD3ZJHX0ltM91Gbynu10+xN5i7j6TdNQyE9CfO+Xz7Gv" > ~/.ssh/known_hosts - - name: Run tox to build site and deploy + - run: lektor deploy ghpages-https if: env.DEPLOY == 'true' env: - LEKTOR_DEPLOY_USERNAME: ${{ secrets.LEKTOR_DEPLOY_USERNAME }} - LEKTOR_DEPLOY_PASSWORD: ${{ secrets.LEKTOR_DEPLOY_PASSWORD }} - run: tox -e deploy + LEKTOR_DEPLOY_USERNAME: lektor + LEKTOR_DEPLOY_PASSWORD: ${{ secrets.GITHUB_TOKEN }} diff --git a/Website.lektorproject b/Website.lektorproject index b6b1818b..22a61025 100644 --- a/Website.lektorproject +++ b/Website.lektorproject @@ -3,17 +3,18 @@ name = Lektor url = https://www.getlektor.com/ url_style = relative -[servers.production] -enabled = yes -name = Production -target = rsync://deploy@flow.srv.pocoo.org/srv/websites/getlektor.com/static -default = yes - [servers.ghpages] enabled = yes name = Github pages on repo -target = ghpages+https://lektor/_deployed-lektor-website -default = no +target = ghpages://lektor/lektor-website +default = yes + +[servers.ghpages-https] +enabled = yes +name = Github pages on repo +target = ghpages+https://lektor/lektor-website +default = not + [packages] lektor-webpack-support = 0.3 diff --git a/tox.ini b/tox.ini index f20212a9..58f0faaa 100644 --- a/tox.ini +++ b/tox.ini @@ -10,9 +10,3 @@ deps = commands = lektor plugins reinstall lektor build - -[testenv:deploy] -commands = - lektor plugins reinstall - lektor build - lektor deploy production