Skip to content

Commit 6a95f8a

Browse files
Deploy docs with official Pages actions (#97)
## Summary Move docs publishing to GitHub's official Pages actions. The build stays read-only, while the deploy job gets only the permissions it needs. ```mermaid flowchart LR A["Switch Pages source to GitHub Actions"] --> B["Merge this PR"] B --> C["Build docs"] C --> D["Upload Pages artifact"] D --> E["Deploy site"] ``` ## Verification Tried this end-to-end with two tiny demos, one per approach. Both deploy fine, and the after one skips Jekyll so no `.nojekyll` is needed: - before: https://github.com/natalie-o-perret/demo-python-gh-pages-jamesives - after: https://github.com/natalie-o-perret/demo-python-gh-pages-official --- > [!NOTE] > AI assistance: PR description.
1 parent 3edf0ce commit 6a95f8a

1 file changed

Lines changed: 24 additions & 5 deletions

File tree

.github/workflows/docs.yaml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@ name: Publish docs
55
branches:
66
- "master"
77
permissions:
8-
contents: write
8+
contents: read
9+
10+
concurrency:
11+
group: pages
12+
cancel-in-progress: true
13+
914
jobs:
10-
publish-docs:
15+
build-docs:
1116
runs-on: ubuntu-latest
1217
steps:
1318
- name: Checkout
@@ -19,7 +24,21 @@ jobs:
1924
- name: Build docs
2025
run: |
2126
make html
22-
- name: Publish
23-
uses: JamesIves/github-pages-deploy-action@fa24774553152dd7873cd16ebd8d959b010c5445 # v4.9.0
27+
- name: Upload Pages artifact
28+
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
2429
with:
25-
folder: build/html
30+
path: build/html
31+
32+
deploy-docs:
33+
needs: build-docs
34+
runs-on: ubuntu-latest
35+
permissions:
36+
pages: write
37+
id-token: write
38+
environment:
39+
name: github-pages
40+
url: ${{ steps.deployment.outputs.page_url }}
41+
steps:
42+
- name: Deploy to GitHub Pages
43+
id: deployment
44+
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0

0 commit comments

Comments
 (0)