Skip to content

Commit d77e9cb

Browse files
authored
Update Python version used in docs workflow (#314)
* Update Python version used in docs workflow * Trigger docs workflow on pull-requests * Deploy only on push to main
1 parent fe8ac40 commit d77e9cb

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

.github/workflows/docs.yml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,38 @@
11
name: Docs
22

33
on:
4+
pull_request:
5+
branches:
6+
- main
7+
paths:
8+
- .github/workflows/docs.yml
9+
- pyproject.toml
10+
- s2fft/**
11+
- docs/**
12+
- notebooks/**
413
push:
514
branches:
615
- main
7-
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
20+
821
jobs:
922
build:
1023

1124
runs-on: ubuntu-latest
12-
strategy:
13-
matrix:
14-
python-version: [3.9]
1525

1626
steps:
1727
- name: Checkout Source
1828
uses: actions/[email protected]
1929

20-
- name: Set up Python ${{ matrix.python-version }}
30+
- name: Set up Python
2131
uses: actions/setup-python@v5
2232
with:
23-
python-version: ${{ matrix.python-version }}
33+
python-version: 3.x
34+
cache: pip
35+
cache-dependency-path: pyproject.toml
2436

2537
- name: Install dependencies
2638
run: |
@@ -33,7 +45,7 @@ jobs:
3345
cd docs && make html
3446
3547
- name: Deploy
36-
if: github.ref == 'refs/heads/main'
48+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
3749
uses: JamesIves/[email protected]
3850
with:
3951
branch: gh-pages # The branch the action should deploy to.

0 commit comments

Comments
 (0)