File tree Expand file tree Collapse file tree 1 file changed +32
-15
lines changed Expand file tree Collapse file tree 1 file changed +32
-15
lines changed Original file line number Diff line number Diff line change 11name : Deploy Documentation
22on :
33 push :
4- branches :
5- - main # Set the branch you want to trigger the deployment
4+ branches : [main]
5+ pull_request :
6+ branches : [main]
67
78jobs :
8- deploy :
9+ build :
910 runs-on : ubuntu-latest
1011 steps :
1112 - name : Checkout Repository
1213 uses : actions/checkout@v5
13-
14+ with :
15+ persist-credentials : false
16+
1417 - name : Set up Python
1518 uses : actions/setup-python@v4
1619 with :
1720 python-version : ' 3.x'
18-
21+
1922 - name : Install Dependencies
20- run : |
21- python -m pip install --upgrade pip
22- pip install nox
23- nox -s docs
23+ run : pipx run nox -s docs
2424
25+ - name : Upload docs build as artifact
26+ uses : actions/upload-pages-artifact@v4
27+ with :
28+ name : ${{ github.event.repository.name }}_docs
29+ path : ${{ github.workspace }}/site
30+
31+ deploy :
32+ if : github.ref == 'refs/heads/main'
33+ runs-on : ubuntu-latest
34+ needs : [build]
35+ permissions :
36+ # to deploy to Pages
37+ pages : write
38+ # to verify the deployment originates from an appropriate source
39+ id-token : write
40+ # Deploy to the github-pages environment
41+ environment :
42+ name : github-pages
43+ url : ${{ steps.deployment.outputs.page_url }}
44+ steps :
2545 - name : Deploy to GitHub Pages
26- uses : peaceiris/actions-gh-pages@v4
46+ id : deployment
47+ uses : actions/deploy-pages@v4
2748 with :
28- github_token : ${{ secrets.GITHUB_TOKEN }}
29- publish_dir : ./site
30- user_name : ' github-actions[bot]'
31- user_email : ' github-actions[bot]@users.noreply.github.com'
32- commit_message : ' Deploy documentation'
49+ artifact_name : ${{ github.event.repository.name }}_docs
You can’t perform that action at this time.
0 commit comments