Skip to content

Commit 84172f3

Browse files
authored
ci(docs): publish through the shared GitHub Pages workflow (#42)
The workflow was a copy of common-publish-to-github-pages.yml -- same checkout, Pages config, Node setup, Antora build, artifact upload and deploy -- so any fix to one had to be remembered in the other. Two differences, both in the shared workflow's favour: - it passes --log-failure-level=fatal to Antora, so a fatal is a failed build rather than a broken site - the `mkdir -p docs/build/site` guard is gone. It made an Antora run that produced nothing deploy an empty directory instead of failing. The repo's own package-lock.json still pins Antora: the shared build action runs `npm ci` when it finds a lockfile and falls back to a pinned install only when there isn't one. Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
1 parent 2e53e5d commit 84172f3

1 file changed

Lines changed: 9 additions & 36 deletions

File tree

Lines changed: 9 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,20 @@
11
name: Publish to GitHub Pages
2+
23
on:
3-
workflow_dispatch:
4+
workflow_dispatch:
45
release:
56
types: [created]
67
push:
78
branches:
89
- main
910

10-
concurrency:
11-
group: github-pages
12-
cancel-in-progress: false
13-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1411
permissions:
1512
contents: read
16-
pages: write
17-
id-token: write
13+
1814
jobs:
19-
build:
20-
runs-on: ubuntu-latest
21-
environment:
22-
name: github-pages
23-
url: ${{ steps.deployment.outputs.page_url }}
24-
steps:
25-
- name: Checkout repository
26-
uses: actions/checkout@v7
27-
with:
28-
fetch-depth: 0
29-
- name: Configure Pages
30-
uses: actions/configure-pages@v6
31-
- name: Install Node.js
32-
uses: actions/setup-node@v7
33-
with:
34-
node-version: "24"
35-
- name: Install dependencies
36-
run: npm ci
37-
- name: Generate Site
38-
run: npx antora docs/antora-playbook.yml
39-
- name: Create site folders
40-
run: mkdir -p docs/build/site
41-
- name: Upload Artifacts
42-
uses: actions/upload-pages-artifact@v5
43-
with:
44-
path: docs/build/site
45-
- name: Deploy to GitHub Pages
46-
id: deployment
47-
uses: actions/deploy-pages@v5
15+
publish:
16+
uses: reqstool/.github/.github/workflows/common-publish-to-github-pages.yml@main
17+
permissions:
18+
contents: read
19+
pages: write
20+
id-token: write

0 commit comments

Comments
 (0)