-
Notifications
You must be signed in to change notification settings - Fork 29
66 lines (58 loc) · 1.8 KB
/
Copy pathdocs.yml
File metadata and controls
66 lines (58 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Build the mkdocs site on every push/PR; deploy to GitHub Pages when
# main is updated. Matches the pattern used by openvax/vaxrank.
#
# For the deploy to work, the repository's Pages source must be set to
# "GitHub Actions" under Settings → Pages. The build job runs on PRs
# so broken docs fail the check before merge.
name: Docs
on:
push:
branches: [main]
pull_request:
branches: [main]
# Cancel in-flight runs on the same ref when a newer push arrives.
concurrency:
group: docs-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0 # mkdocs plugins can look at git history
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
cache: pip
- name: Install varcode and docs dependencies
run: |
python -m pip install --upgrade pip
# mkdocstrings needs varcode importable, but doesn't need
# the Ensembl FASTA caches that the test workflow downloads.
pip install -r requirements.txt
pip install .
pip install mkdocs mkdocs-material 'mkdocstrings[python]'
- name: Build docs
run: mkdocs build
- name: Upload site artifact
if: github.ref == 'refs/heads/main'
uses: actions/[email protected]
with:
path: site/
deploy:
needs: build
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5