54 lines
1.1 KiB
YAML
54 lines
1.1 KiB
YAML
name: "Deploy site"
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- "*"
|
|
push:
|
|
branches:
|
|
- "master"
|
|
workflow_dispatch:
|
|
# Allow manually running workflow
|
|
schedule:
|
|
- cron: "23 2 * * *"
|
|
|
|
env:
|
|
DEPLOY: >-
|
|
${{
|
|
github.event_name != 'pull_request'
|
|
&&
|
|
github.ref == 'refs/heads/master'
|
|
}}
|
|
|
|
jobs:
|
|
build:
|
|
name: Build lektor website
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "lts/*"
|
|
cache: npm
|
|
cache-dependency-path: webpack/package-lock.json
|
|
|
|
- uses: pdm-project/setup-pdm@v4
|
|
with:
|
|
cache: true
|
|
|
|
- name: Install Lektor
|
|
run: pdm install
|
|
- name: Build lektor website
|
|
run: pdm run build
|
|
|
|
- name: Check for broken internal links
|
|
run: pdm run check-links
|
|
|
|
- name: Deploy lektor website
|
|
if: env.DEPLOY == 'true'
|
|
run: pdm run deploy
|
|
env:
|
|
LEKTOR_DEPLOY_USERNAME: lektor
|
|
LEKTOR_DEPLOY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
|