-
Notifications
You must be signed in to change notification settings - Fork 41
54 lines (52 loc) · 1.51 KB
/
build.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
name: Build and deploy docs
on:
push:
branches:
- main
jobs:
build_docs:
name: Build docs and deploy to gh-pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install poetry
run: pip install poetry
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: poetry
cache-dependency-path: pyproject.toml
- name: Install dependencies
run: |
poetry install
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
source $HOME/.cargo/env
cargo install mdbook
- name: Get PR number
uses: jwalton/gh-find-current-pr@v1
id: findPr
with:
state: all
- name: Set commit message
run: |
if [ -z "$PR" ]
then
echo "COMMIT_MESSAGE=:octocat: Update docs" >> $GITHUB_ENV
else
echo "COMMIT_MESSAGE=:octocat: Update docs for #$PR" >> $GITHUB_ENV
fi
env:
PR: ${{ steps.findPr.outputs.pr }}
- name: Build docs
run: make docs
- name: Deploy on gh-pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: out
commit-message: ${{ env.COMMIT_MESSAGE }}
clean: true
git-config-name: github-actions
git-config-email: [email protected]