generated from alan-cooney/transformer-lens-starter-template
-
Notifications
You must be signed in to change notification settings - Fork 39
60 lines (57 loc) · 1.62 KB
/
gh-pages.yml
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
name: Docs
on:
push:
branches:
- main
pull_request:
branches:
- '*'
permissions:
contents: write
jobs:
build-docs:
# When running on a PR, this just checks we can build the docs without errors
# When running on merge to main, it builds the docs and then another job deploys them
name: ${{ github.event_name == 'pull_request' && 'Check Build Docs' || 'Build Docs' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: "poetry"
- name: Install poe
run: pip install poethepoet
- name: Install dependencies
run: poetry install --with docs
- name: Generate docs
run: poe gen-docs
- name: Build Docs
run: poe make-docs
- name: Upload Docs Artifact
uses: actions/upload-artifact@v3
with:
name: documentation
path: docs/generated
deploy-docs:
name: Deploy Docs
runs-on: ubuntu-latest
# Only run if merging a PR into main
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: build-docs
steps:
- uses: actions/checkout@v4
- name: Download Docs Artifact
uses: actions/download-artifact@v3
with:
name: documentation
path: docs/generated
- name: Upload to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs/generated
clean-exclude: |
*.*.*/