Skip to content

data: zero source warnings (1,663→0), +54 country canons (2,339→2,393), harden Pages deploy #255

data: zero source warnings (1,663→0), +54 country canons (2,339→2,393), harden Pages deploy

data: zero source warnings (1,663→0), +54 country canons (2,339→2,393), harden Pages deploy #255

Workflow file for this run

name: Build and Deploy
on:
push:
branches: [main]
pull_request:
branches: [main]
# Manual re-run entry point: GitHub Pages deployments intermittently get
# stuck in deployment_queued on GitHub's side; this allows re-triggering
# the whole pipeline from the Actions UI/API without an empty commit.
workflow_dispatch:
jobs:
validate-and-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.12"
- name: Install dependencies
run: pip install -e ".[dev]"
- name: Lint
run: ruff check generator/ tests/
- name: Run tests
run: pytest tests/ -v
- name: Validate canon data
run: python -m generator.validate --data-only
- name: Build site
run: python -m generator.build_site
- name: Prepare site for deployment
run: touch site/.nojekyll
- name: Validate generated HTML
run: python -m generator.validate --site-only
- name: Submit to IndexNow
if: github.ref == 'refs/heads/main'
run: python -m generator.submit_indexnow
continue-on-error: true
- name: Ping search engines
if: github.ref == 'refs/heads/main'
run: python -m generator.ping_search_engines
continue-on-error: true
- name: Create Pages artifact
if: github.ref == 'refs/heads/main'
run: |
tar \
--dereference --hard-dereference \
--directory site/ \
-cvf "$RUNNER_TEMP/artifact.tar" \
.
- name: Upload Pages artifact
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: github-pages
path: ${{ runner.temp }}/artifact.tar
retention-days: 1
if-no-files-found: error
deploy:
if: github.ref == 'refs/heads/main'
needs: validate-and-build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Configure Pages
uses: actions/configure-pages@1f0c5cde4bc74cd7e1254d0cb4de8d49e9068c7d # v4.0.0
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
with:
# Pages deployments intermittently sit in deployment_queued for
# >10 min on GitHub's side; the default 600000 ms timeout then
# aborts and cancels the deployment. Ride out queue backlogs.
timeout: 1800000