Skip to content

Commit 87eef96

Browse files
committed
Update the GitHub Pages workflow.
1 parent 0476794 commit 87eef96

1 file changed

Lines changed: 34 additions & 12 deletions

File tree

.github/workflows/pages.yml

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,27 @@
1-
name: Docs
2-
on: [push, pull_request, workflow_dispatch]
1+
name: Deploy Documentation
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
workflow_dispatch:
8+
39
permissions:
4-
contents: write
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: false
17+
518
jobs:
6-
docs:
19+
build:
720
runs-on: ubuntu-latest
821
steps:
9-
- uses: actions/checkout@v3
22+
- uses: actions/checkout@v4
1023

11-
- uses: actions/setup-python@v3
24+
- uses: actions/setup-python@v5
1225
with:
1326
python-version: '3.10'
1427

@@ -23,11 +36,20 @@ jobs:
2336
cd docs
2437
make html
2538
26-
- name: Deploy
27-
uses: peaceiris/actions-gh-pages@v3
39+
- name: Upload artifact
2840
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
41+
uses: actions/upload-pages-artifact@v3
2942
with:
30-
publish_branch: gh-pages
31-
github_token: ${{ secrets.GITHUB_TOKEN }}
32-
publish_dir: docs/_build/html
33-
force_orphan: true
43+
path: docs/_build/html
44+
45+
deploy:
46+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
47+
environment:
48+
name: github-pages
49+
url: ${{ steps.deployment.outputs.page_url }}
50+
runs-on: ubuntu-latest
51+
needs: build
52+
steps:
53+
- name: Deploy to GitHub Pages
54+
id: deployment
55+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)