2020-05-07 03:50:42 +02:00
|
|
|
name: "Deploy site"
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- '*'
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'master'
|
2021-12-21 07:47:30 +01:00
|
|
|
workflow_dispatch:
|
|
|
|
# Allow manually running workflow
|
|
|
|
schedule:
|
|
|
|
- cron: '23 2 * * *'
|
2020-05-07 03:50:42 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
deploy-lektor-website:
|
|
|
|
name: Deploy lektor website
|
|
|
|
runs-on: ubuntu-latest
|
2021-12-21 07:47:30 +01:00
|
|
|
env:
|
|
|
|
DEPLOY: ${{ github.event_name != 'pull_request' }}
|
2020-05-07 03:50:42 +02:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2022-02-23 02:04:31 +01:00
|
|
|
|
2020-05-07 03:50:42 +02:00
|
|
|
- uses: actions/setup-python@v2
|
2021-12-21 07:47:30 +01:00
|
|
|
|
2022-02-23 02:04:31 +01:00
|
|
|
- name: Install Lektor
|
2022-01-06 07:23:53 +01:00
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip setuptools
|
2022-02-23 02:04:31 +01:00
|
|
|
python -m pip install lektor
|
2021-12-21 07:47:30 +01:00
|
|
|
|
2022-02-23 02:04:31 +01:00
|
|
|
- run: lektor build
|
2021-12-21 07:47:30 +01:00
|
|
|
|
2022-02-23 02:04:31 +01:00
|
|
|
- run: lektor deploy ghpages-https
|
2021-12-21 07:47:30 +01:00
|
|
|
if: env.DEPLOY == 'true'
|
2020-05-07 03:50:42 +02:00
|
|
|
env:
|
2022-02-23 02:04:31 +01:00
|
|
|
LEKTOR_DEPLOY_USERNAME: lektor
|
|
|
|
LEKTOR_DEPLOY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
|