lektor-website/.github/workflows/deploy.yml

59 lines
1.3 KiB
YAML
Raw Permalink Normal View History

name: "Deploy site"
on:
pull_request:
branches:
2022-12-17 08:17:16 +01:00
- "*"
push:
branches:
2022-12-17 08:17:16 +01:00
- "master"
workflow_dispatch:
# Allow manually running workflow
schedule:
2022-12-17 08:17:16 +01:00
- cron: "23 2 * * *"
2022-02-27 23:38:54 +01:00
env:
DEPLOY: >-
${{
github.event_name != 'pull_request'
&&
github.ref == 'refs/heads/master'
}}
OUTPUT: _html
jobs:
2022-02-27 23:38:54 +01:00
build:
name: Build lektor website
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
2022-12-17 08:17:16 +01:00
with:
python-version: "3.12"
- uses: actions/setup-node@v4
2022-12-17 08:17:16 +01:00
with:
node-version: "lts/*"
- name: Install Lektor
run: |
python -m pip install --upgrade pip setuptools
python -m pip install lektor
2022-02-27 23:38:54 +01:00
- name: Build lektor website
2022-12-17 08:17:16 +01:00
run: lektor build -f webpack -O '${{ env.OUTPUT }}'
2022-02-27 23:38:54 +01:00
- name: Check for broken internal links
uses: wjdp/htmltest-action@master
with:
path: ${{ env.OUTPUT }}
config: .htmltest.yml
skip_external: true
log_level: 1
2022-02-27 23:38:54 +01:00
- name: Deploy lektor website
if: env.DEPLOY == 'true'
2022-02-27 23:38:54 +01:00
run: lektor deploy -O '${{ env.OUTPUT }}' ghpages-https
env:
LEKTOR_DEPLOY_USERNAME: lektor
LEKTOR_DEPLOY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}