-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (40 loc) · 1.34 KB
/
docs.yaml
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
name: Build and Deploy Documentation
on:
push:
branches:
- main
- dev
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Dependencies
run: |
python -m pip install -U pip poetry
python -m poetry install --no-cache -E docs
- name: Determine Version
id: determine_version
run: |
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
VERSION="v$(python -c "import quadra; print(quadra.__version__)")"
elif [[ "${{ github.ref }}" == "refs/heads/dev" ]]; then
VERSION="dev"
fi
echo "::set-output name=version::$VERSION"
- name: Build Documentation
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git fetch origin gh-pages --depth=1
VERSION="${{ steps.determine_version.outputs.version }}"
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
poetry run mike deploy --push --update-aliases $VERSION latest
else
poetry run mike deploy --push $VERSION
fi