Skip to content

Commit b8d09ab

Browse files
committed
Update docs GitHub Pages workflow
Revamp the docs CI to target GitHub Pages: add workflow_dispatch trigger, set explicit pages/content/id-token permissions, and configure concurrency (group "pages"; do not cancel in-progress runs). Split into build and deploy jobs so build checks out code, uses setup-node@v6 (node 25) and uploads the site artifact, while a separate deploy job (with github-pages environment) runs the deploy step. Bump actions to newer versions (actions/checkout@v6, actions/setup-node@v6, actions/upload-pages-artifact@v4, actions/deploy-pages@v4) and add actions/configure-pages@v5 to prepare Pages deployment.
1 parent 4e3bbe3 commit b8d09ab

1 file changed

Lines changed: 25 additions & 16 deletions

File tree

.github/workflows/docs.yml

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
name: Deploy Docs
1+
---
2+
name: Deploy to GitHub Pages
23

34
on:
45
push:
5-
branches: [main]
6-
paths:
7-
- 'docs/**'
6+
branches:
7+
- main
8+
workflow_dispatch:
89

10+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
911
permissions:
1012
contents: read
1113
pages: write
1214
id-token: write
1315

16+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
17+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
1418
concurrency:
15-
group: pages
16-
cancel-in-progress: true
19+
group: "pages"
20+
cancel-in-progress: false
1721

1822
jobs:
19-
deploy:
23+
build:
2024
runs-on: ubuntu-latest
21-
environment:
22-
name: github-pages
23-
url: ${{ steps.deployment.outputs.page_url }}
24-
2525
steps:
26-
- uses: actions/checkout@v4
26+
- uses: actions/checkout@v6
2727

2828
- name: Set up Node.js
29-
uses: actions/setup-node@v4
29+
uses: actions/setup-node@v6
3030
with:
31-
node-version: 20
31+
node-version: 25
3232
cache: npm
3333
cache-dependency-path: docs/package-lock.json
3434

@@ -40,12 +40,21 @@ jobs:
4040
working-directory: docs
4141
run: npm run build
4242

43+
- name: Setup Pages
44+
uses: actions/configure-pages@v5
45+
4346
- name: Upload artifact
44-
uses: actions/upload-pages-artifact@v3
47+
uses: actions/upload-pages-artifact@v4
4548
with:
4649
path: docs/build
47-
overwrite: true
4850

51+
deploy:
52+
environment:
53+
name: github-pages
54+
url: ${{ steps.deployment.outputs.page_url }}
55+
runs-on: ubuntu-latest
56+
needs: build
57+
steps:
4958
- name: Deploy to GitHub Pages
5059
id: deployment
5160
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)