Skip to content

Commit 1d25b73

Browse files
committed
Optimize/Fix docs action (zimor checks)
1 parent 9c1e00b commit 1d25b73

1 file changed

Lines changed: 17 additions & 10 deletions

File tree

.github/workflows/merge.yml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
# - checkout gh-pages for updating
55
# - build sphinx docs/site
66
# - publish new docs to gh-pages
7+
#
8+
# passes all zizmor --nitpicky checks (zizmor 1.19.0)
79

810
name: Build docs
911
on:
@@ -20,26 +22,24 @@ env:
2022
PIP_PROGRESS_BAR: "off"
2123
LOGLEVEL: "DEBUG"
2224

25+
permissions: {}
26+
27+
concurrency:
28+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
29+
cancel-in-progress: true
30+
2331
jobs:
2432
build:
2533
name: Build documentation for gh-pages
2634
permissions:
27-
# Required for peaceiris/actions-gh-pages below
28-
contents: write
35+
contents: read
2936
runs-on: ubuntu-latest
30-
timeout-minutes: 10
3137
steps:
3238
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
3339
with:
3440
# Using fetch-depth 0 is the only way to get all tags which are needed for building docs.
3541
fetch-depth: 0
36-
37-
- name: Checkout gh-pages branch to dir publish/
38-
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
39-
with:
40-
ref: gh-pages
41-
path: publish
42-
fetch-depth: 1
42+
persist-credentials: false
4343

4444
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548
4545
with:
@@ -61,6 +61,13 @@ jobs:
6161
with:
6262
path: 'docs/_build/html'
6363

64+
publish:
65+
name: Publish documentation on gh-pages
66+
permissions:
67+
id-token: write # Required to write to gh-pages branch
68+
contents: read
69+
runs-on: ubuntu-latest
70+
steps:
6471
- name: Deploy updated gh-pages content
6572
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e
6673
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main'

0 commit comments

Comments
 (0)