56 lines
1.3 KiB
YAML
56 lines
1.3 KiB
YAML
name: Publish GitHub Pages output
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
schedule:
|
|
- cron: '*/5 * * * *'
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: publish-github-pages
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out source
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Use Node.js 24
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 24
|
|
cache: npm
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Check publication time
|
|
id: publication
|
|
shell: bash
|
|
run: |
|
|
set +e
|
|
node scripts/verify-pages-public-data.mjs
|
|
status=$?
|
|
set -e
|
|
if [ "$status" -eq 0 ]; then
|
|
echo "ready=true" >> "$GITHUB_OUTPUT"
|
|
elif [ "$status" -eq 78 ]; then
|
|
echo "ready=false" >> "$GITHUB_OUTPUT"
|
|
echo "Public data is not due yet; skipping this scheduled deployment."
|
|
else
|
|
exit "$status"
|
|
fi
|
|
|
|
- name: Build public site
|
|
if: steps.publication.outputs.ready == 'true'
|
|
run: npm run build:pages
|
|
|
|
- name: Publish generated files
|
|
if: steps.publication.outputs.ready == 'true'
|
|
env:
|
|
GITHUB_PAGES_TOKEN: ${{ secrets.GITHUB_PAGES_TOKEN }}
|
|
run: npm run publish:pages
|