Skip to content

Commit c83b89b

Browse files
committed
ci: push the documentation to the gh-pages branch
GitHub Pages serves the gh-pages branch, but the workflow used deploy-pages, which needs the Pages source set to GitHub Actions and a job environment, so every deployment failed. Push the built HTML to gh-pages instead.
1 parent 342692a commit c83b89b

1 file changed

Lines changed: 9 additions & 17 deletions

File tree

‎.github/workflows/documentation.yml‎

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@ on:
2323

2424
workflow_dispatch:
2525

26-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
26+
# GitHub Pages serves the gh-pages branch, so the GITHUB_TOKEN must be able
27+
# to push to it.
2728
permissions:
28-
contents: read
29-
pages: write
30-
id-token: write
29+
contents: write
3130

3231
# Allow one concurrent deployment per branch/pr
3332
concurrency:
@@ -77,18 +76,11 @@ jobs:
7776
retention-days: 30
7877

7978

80-
- name: Setup Pages
81-
uses: actions/configure-pages@v6
82-
if: ${{ github.event_name == 'push' && ( startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' ) }}
83-
84-
- name: Upload artifact
85-
uses: actions/upload-pages-artifact@v5
86-
if: ${{ github.event_name == 'push' && ( startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' ) }}
87-
with:
88-
# Upload entire repository
89-
path: docs/_build/html/
90-
9179
- name: Deploy to GitHub Pages
92-
id: deployment
9380
if: ${{ github.event_name == 'push' && ( startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' ) }}
94-
uses: actions/deploy-pages@v5
81+
uses: peaceiris/actions-gh-pages@v4
82+
with:
83+
github_token: ${{ secrets.GITHUB_TOKEN }}
84+
publish_branch: gh-pages
85+
publish_dir: docs/_build/html/
86+
force_orphan: true

0 commit comments

Comments
 (0)