-
Notifications
You must be signed in to change notification settings - Fork 274
86 lines (67 loc) · 2.18 KB
/
Copy pathdocs.yml
File metadata and controls
86 lines (67 loc) · 2.18 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Build and deploy documentation
on:
push:
permissions:
contents: write
concurrency:
group: docs-${{ github.ref }}
cancel-in-progress: true
env:
FORCE_COLOR: 1
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v6
- name: Install dependencies
run: uv sync --group doc
- name: Install just
uses: extractions/setup-just@v3
- name: Restore TorchIO cached data
id: cache-torchio-data-restore
uses: actions/cache/restore@v4
with:
path: ~/.cache/torchio
key: ${{ runner.os }}-torchio-data
- name: Build docs
run: just build-docs
- name: Save TorchIO cached data
if: steps.cache-torchio-data-restore.outputs.cache-hit != 'true'
id: cache-torchio-data-save
uses: actions/cache@v4
with:
path: ~/.cache/torchio
key: ${{ steps.cache-torchio-data-restore.outputs.cache-primary-key }}
# Uploade to smokeshow if not on main branch
- name: Upload docs to smokeshow
if: github.ref != 'refs/heads/main'
run: |
rm ./docs/build/html/_images/*.gif
rm ./docs/build/html/_images/*.png
uvx smokeshow upload ./docs/build/html
# Upload to GitHub Pages if on main branch
- name: Upload artifacts using actions/upload-pages-artifact
if: github.ref == 'refs/heads/main'
id: deployment
uses: actions/upload-pages-artifact@v3
with:
path: ./docs/build/html
deploy:
if: github.ref == 'refs/heads/main'
needs: build
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
runs-on: ubuntu-latest
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4