Skip to content

Commit 3f4b595

Browse files
update workflow to publish to gh pages directly instead of separate branch
1 parent 981e5a4 commit 3f4b595

2 files changed

Lines changed: 31 additions & 15 deletions

File tree

.github/workflows/docs_pages.yaml

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
name: Docs2Pages
22
on: [ push, pull_request, workflow_dispatch ]
3-
permissions:
4-
contents: write
53

6-
concurrency:
7-
group: docs-${{ github.ref }}
8-
cancel-in-progress: true
4+
permissions: {}
95

106
jobs:
11-
build-docs:
7+
build:
128
runs-on: ubuntu-latest
9+
concurrency:
10+
group: docs-build-${{ github.ref }}
11+
cancel-in-progress: true
12+
permissions:
13+
contents: read
1314
steps:
1415
- name: Checkout
1516
uses: actions/checkout@v5
@@ -24,14 +25,29 @@ jobs:
2425
run: uv sync --all-extras
2526

2627
- name: Build MkDocs site
27-
run: |
28-
uv run mkdocs build --strict
28+
run: uv run mkdocs build --strict
2929

30-
- name: Deploy documentation
31-
uses: peaceiris/actions-gh-pages@v4
30+
- name: Upload Pages artifact
3231
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
32+
uses: actions/upload-pages-artifact@v3
3333
with:
34-
publish_branch: gh-pages
35-
github_token: ${{ secrets.GITHUB_TOKEN }}
36-
publish_dir: ./docs/build/html
37-
force_orphan: true
34+
path: ./docs/build/html
35+
36+
deploy:
37+
needs: build
38+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
39+
runs-on: ubuntu-latest
40+
permissions:
41+
pages: write
42+
id-token: write
43+
environment:
44+
name: github-pages
45+
url: ${{ steps.deployment.outputs.page_url }}
46+
# Per GitHub Pages guidance: don't cancel an in-flight deploy.
47+
concurrency:
48+
group: pages
49+
cancel-in-progress: false
50+
steps:
51+
- name: Deploy to GitHub Pages
52+
id: deployment
53+
uses: actions/deploy-pages@v4

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)