Skip to content

Commit e4da88b

Browse files
committed
deploy only on releases
1 parent 9cd0eb1 commit e4da88b

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

.github/workflows/deploy-docs.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,41 @@
11
name: Build and Deploy docs
22

3+
# no permissions by default
4+
permissions: {}
5+
36
on:
47
pull_request:
58
push:
6-
branches: [main]
7-
workflow_dispatch:
9+
branches:
10+
- main
11+
release:
12+
types:
13+
- published
814

915
jobs:
1016
build-docs:
1117
runs-on: ubuntu-latest
18+
permissions:
19+
contents: write
1220

1321
steps:
1422
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
23+
with:
24+
persist-credentials: false
1525

1626
- name: Set up Python
1727
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
1828
with:
1929
python-version: "3.x"
2030

21-
2231
- name: Build documentation
2332
run: >
2433
set -e
2534
&& pip install jupyter-book
2635
&& jupyter-book build jupyterbook
2736
2837
- name: GitHub Pages action
29-
if: github.ref == 'refs/heads/main'
38+
if: success() && github.event_name == 'release'
3039
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
3140
with:
3241
github_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)