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.
This commit is contained in:
Jeff Dairiki 2022-02-22 17:04:31 -08:00
parent 962be2e941
commit abe0593395
3 changed files with 16 additions and 30 deletions

View File

@ -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 }}

View File

@ -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

View File

@ -10,9 +10,3 @@ deps =
commands =
lektor plugins reinstall
lektor build
[testenv:deploy]
commands =
lektor plugins reinstall
lektor build
lektor deploy production