mirror of
https://github.com/lektor/lektor-website.git
synced 2025-02-12 11:10:37 +01:00
![Jeff Dairiki](/assets/img/avatar_default.png)
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.
38 lines
798 B
YAML
38 lines
798 B
YAML
name: "Deploy site"
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- '*'
|
|
push:
|
|
branches:
|
|
- 'master'
|
|
workflow_dispatch:
|
|
# Allow manually running workflow
|
|
schedule:
|
|
- cron: '23 2 * * *'
|
|
|
|
jobs:
|
|
deploy-lektor-website:
|
|
name: Deploy lektor website
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
DEPLOY: ${{ github.event_name != 'pull_request' }}
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-python@v2
|
|
|
|
- name: Install Lektor
|
|
run: |
|
|
python -m pip install --upgrade pip setuptools
|
|
python -m pip install lektor
|
|
|
|
- run: lektor build
|
|
|
|
- run: lektor deploy ghpages-https
|
|
if: env.DEPLOY == 'true'
|
|
env:
|
|
LEKTOR_DEPLOY_USERNAME: lektor
|
|
LEKTOR_DEPLOY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
|