-
Notifications
You must be signed in to change notification settings - Fork 3
63 lines (58 loc) · 2.06 KB
/
documentation.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
61
62
63
name: Documentation
on:
release:
types:
- published
- deleted
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: write
jobs:
documentation:
env:
DOCS_BRANCH: docs-site
runs-on: ubuntu-latest
steps:
- name: Checkout ${{ env.DOCS_BRANCH }}
uses: actions/checkout@v4
with:
ref: ${{ env.DOCS_BRANCH }}
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Install Poetry
run: pipx install poetry==1.8.3
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: poetry
- name: Install project and dependencies
run: |
poetry install --sync
poetry env info
- name: Generate markdown
run: poetry run bash scripts/generate_instructions.sh
- name: Build and deploy dev documentation
if: ${{ github.event_name == 'push' }}
run: poetry run mike deploy --push --branch=${{ env.DOCS_BRANCH }} dev
- name: Build and deploy published tag documentation
if: ${{ github.event_name == 'release' && github.event.action == 'published' }}
run: |
echo "Creating documentation version ${{ github.ref_name }}"
poetry run mike deploy --push --branch=${{ env.DOCS_BRANCH }} --update-aliases ${{ github.ref_name }} latest
poetry run mike set-default --push --branch=${{ env.DOCS_BRANCH }} latest
- name: Remove deleted tag documentation
if: ${{ github.event_name == 'release' && github.event.action == 'deleted' }}
run: |
echo "Deleting documentation version ${{ github.ref_name }}"
poetry run mike delete --push --branch=${{ env.DOCS_BRANCH }} ${{ github.ref_name }}
- name: Build documentation for pull request
if: ${{ github.event_name == 'pull_request' }}
run: poetry run mkdocs build