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
|
|
|
|
2022-02-27 23:38:54 +01:00
|
|
|
env:
|
|
|
|
DEPLOY: >-
|
|
|
|
${{
|
|
|
|
github.event_name != 'pull_request'
|
|
|
|
&&
|
|
|
|
github.ref == 'refs/heads/master'
|
|
|
|
}}
|
|
|
|
OUTPUT: _html
|
|
|
|
|
2020-05-07 03:50:42 +02:00
|
|
|
jobs:
|
2022-02-27 23:38:54 +01:00
|
|
|
build:
|
|
|
|
name: Build lektor website
|
2020-05-07 03:50:42 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
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-27 23:38:54 +01:00
|
|
|
- name: Build lektor website
|
|
|
|
run: lektor build -O '${{ env.OUTPUT }}'
|
|
|
|
|
|
|
|
- name: Check for broken internal links
|
|
|
|
uses: wjdp/htmltest-action@master
|
|
|
|
with:
|
|
|
|
path: ${{ env.OUTPUT }}
|
|
|
|
config: .htmltest.yml
|
|
|
|
skip_external: true
|
|
|
|
log_level: 1
|
2021-12-21 07:47:30 +01:00
|
|
|
|
2022-02-27 23:38:54 +01:00
|
|
|
- name: Deploy lektor website
|
2021-12-21 07:47:30 +01:00
|
|
|
if: env.DEPLOY == 'true'
|
2022-02-27 23:38:54 +01:00
|
|
|
run: lektor deploy -O '${{ env.OUTPUT }}' ghpages-https
|
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 }}
|