-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (95 loc) · 2.85 KB
/
docs.yml
File metadata and controls
114 lines (95 loc) · 2.85 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: docs
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
pages: write
id-token: write
contents: write
pull-requests: write
jobs:
build:
runs-on: ubuntu-latest-32gb
steps:
- name: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 48
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install package
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
sudo apt-get install graphviz pandoc
pip install -e .[doc]
- name: Build with Sphinx
run: |
cd ./docs
make html
- name: Upload build artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/_build/html/
deploy:
if: github.event_name == 'push'
environment:
name: github-pages
url: ${{steps.deployment.outputs.page_url}}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
deploy-preview:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: 'Download build artifact'
uses: actions/download-artifact@v4
with:
name: github-pages
path: github-pages
- name: Decompress build artifact
run: |
cd github-pages
tar -xvf artifact.tar
rm artifact.tar
cd ..
- name: Save URL slug variable
run: |
echo "URL_SLUG=${{ github.event.number }}-${{ github.head_ref }}" >> $GITHUB_ENV
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: github-pages
ssh-key: ${{ secrets.DEPLOY_KEY }}
repository-name: esis-mission/esis-pr-previews
branch: 'main'
clean: true
target-folder: ${{ env.URL_SLUG }}
commit-message: "Update preview for PR ${{ env.URL_SLUG }}"
single-commit: true
git-config-name: esis-bot
git-config-email: roytsmart+esis-bot@gmail.com
- name: Comment PR
uses: thollander/actions-comment-pull-request@v2
with:
message: |
Documentation preview available at https://esis-mission.github.io/esis-pr-previews/${{ env.URL_SLUG }}
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.
pr_number: ${{ github.event.number }}
comment_tag: 'esis-preview'