Files
worktrunk/.github/workflows/publish-docs.yaml
Maximilian Roos e3adde218f ci: share the docs build action (#3874)
PR validation, nightly link checking, and docs publishing each had their
own copy of the Astro setup and build steps. This moves that sequence
into one local composite action and makes all three jobs run the same
checks, asset fetch, build, and built-site tests.

The workflow path filters now include the shared action, so changes to
it exercise PR validation and the publishing path.

The single `setup-node` pin is v7, superseding the three-copy bump in
#3869.

Tested with the full docs command sequence, Actionlint, YAML validation,
and action metadata validation.

> _This was written by Codex on behalf of @max-sixty_
2026-08-22 12:10:18 -07:00

58 lines
1.2 KiB
YAML

name: publish-docs
# Runner versions pinned; see ci.yaml header comment for rationale.
on:
push:
branches:
- main
paths:
- 'docs/**'
- 'src/cli/mod.rs'
- '.github/actions/docs-build/**'
- '.github/workflows/publish-docs.yaml'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-docs:
runs-on: ubuntu-24.04
steps:
- name: 📂 Checkout code
uses: actions/checkout@v7
- name: 🕷️ Check and build docs
uses: ./.github/actions/docs-build
- uses: actions/upload-pages-artifact@v5
with:
path: docs/dist/
retention-days: 1
deploy-docs:
needs: build-docs
runs-on: ubuntu-24.04
# Don't attempt to publish if on a fork
if: ${{ github.repository_owner == 'max-sixty' }}
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Setup Pages
id: pages
uses: actions/configure-pages@v6
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5