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' }} DEPLOY: ${{ github.event_name != 'pull_request' }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/setup-python@v2 - uses: actions/setup-python@v2
- name: Install tox - name: Install Lektor
run: | run: |
python -m pip install --upgrade pip setuptools python -m pip install --upgrade pip setuptools
python -m pip install tox python -m pip install lektor
- run: echo DEPLOY='${{ env.DEPLOY }}' - run: lektor build
- name: Run tox to build site
if: env.DEPLOY != 'true'
run: tox
- name: Add flow.srv.pocoo.org to ~/.ssh/known_hosts - run: lektor deploy ghpages-https
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
if: env.DEPLOY == 'true' if: env.DEPLOY == 'true'
env: env:
LEKTOR_DEPLOY_USERNAME: ${{ secrets.LEKTOR_DEPLOY_USERNAME }} LEKTOR_DEPLOY_USERNAME: lektor
LEKTOR_DEPLOY_PASSWORD: ${{ secrets.LEKTOR_DEPLOY_PASSWORD }} LEKTOR_DEPLOY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
run: tox -e deploy

View File

@ -3,17 +3,18 @@ name = Lektor
url = https://www.getlektor.com/ url = https://www.getlektor.com/
url_style = relative 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] [servers.ghpages]
enabled = yes enabled = yes
name = Github pages on repo name = Github pages on repo
target = ghpages+https://lektor/_deployed-lektor-website target = ghpages://lektor/lektor-website
default = no default = yes
[servers.ghpages-https]
enabled = yes
name = Github pages on repo
target = ghpages+https://lektor/lektor-website
default = not
[packages] [packages]
lektor-webpack-support = 0.3 lektor-webpack-support = 0.3

View File

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