-
Notifications
You must be signed in to change notification settings - Fork 16
49 lines (40 loc) · 1.37 KB
/
docs-build-pr.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
name: Build docs
on:
pull_request:
branches: [ main, 'maint/*' ]
jobs:
build:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Determine current branch/tag name
run: |
if [[ "$GITHUB_REF" == refs/pull/* ]]; then
CURBRANCH=${GITHUB_REF%/*}
CURBRANCH=${CURBRANCH##*/}
elif [[ "$GITHUB_REF" == refs/heads/* ]]; then
CURBRANCH=${GITHUB_REF##*/}
elif [[ "$GITHUB_REF" == refs/tags/* ]]; then
echo "This build should not be picking up a tag, cancelling."
exit 1
fi
# Remove forward slashes
CURBRANCH=$( echo $CURBRANCH | sed 's+/+_+g' )
echo "Building branch/tag ${CURBRANCH:-<unkwown>}, from git ref <$GITHUB_REF>"
echo "CURBRANCH=${CURBRANCH}" >> ${GITHUB_ENV}
- name: Install GraphViz
run: |
sudo apt-get update -y
sudo apt-get install -y --no-install-recommends graphviz
- name: Install dependencies
run: |
pip install -U build hatch pip
pip install .[doc]
python -m hatch version | tail -n1
- name: Build docs
run: |
python -m hatch build --hooks-only
make -C docs/ SPHINXOPTS="-W -v" BUILDDIR="$HOME/docs" OUTDIR="${CURBRANCH:-html}" html