Skip to content

Commit ba9fcbf

Browse files
committed
switch to gh
1 parent 4ef6443 commit ba9fcbf

1 file changed

Lines changed: 68 additions & 0 deletions

File tree

.github/workflows/docs.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Deploy docs to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
# Allow only one concurrent deployment, skipping runs queued between the run
11+
# in-progress and latest queued. Do NOT cancel in-progress runs so a deploy
12+
# always finishes.
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: false
16+
17+
permissions:
18+
contents: read
19+
20+
jobs:
21+
# Build the Sphinx site on every push and PR (PRs get build validation
22+
# without deploying).
23+
build:
24+
runs-on: ubuntu-latest
25+
defaults:
26+
run:
27+
shell: bash -l {0}
28+
steps:
29+
- uses: actions/checkout@v4
30+
31+
- name: Set up conda docs environment
32+
uses: conda-incubator/setup-miniconda@v3
33+
with:
34+
miniforge-version: latest
35+
channels: conda-forge
36+
environment-file: environment-docs.yml
37+
activate-environment: calphy-docs
38+
39+
- name: Install calphy + doc requirements
40+
run: |
41+
pip install .
42+
pip install -r docs/requirements.txt
43+
44+
- name: Build the documentation
45+
run: |
46+
sphinx-build -b html docs/source docs/_build/html
47+
48+
- name: Upload Pages artifact
49+
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
50+
uses: actions/upload-pages-artifact@v3
51+
with:
52+
path: docs/_build/html
53+
54+
# Deploy to GitHub Pages, only on push to main.
55+
deploy:
56+
needs: build
57+
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
58+
runs-on: ubuntu-latest
59+
environment:
60+
name: github-pages
61+
url: ${{ steps.deployment.outputs.page_url }}
62+
permissions:
63+
pages: write
64+
id-token: write
65+
steps:
66+
- name: Deploy to GitHub Pages
67+
id: deployment
68+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)