-
Notifications
You must be signed in to change notification settings - Fork 4
62 lines (51 loc) · 1.79 KB
/
docs.yml
File metadata and controls
62 lines (51 loc) · 1.79 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
name: Deploy Docs
on:
push:
branches: [main]
pull_request:
branches: [main]
release:
types: [published]
workflow_dispatch:
permissions:
contents: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: '3.12'
- name: Install dependencies
run: pip install 'mkdocs>=1.6,<2' 'mkdocs-material>=9.7,<10' pyyaml mike
- name: Validate docsite config
run: cd scripts && python -m docsite --validate
- name: Build docs
run: cd scripts && python -m docsite --output-dir /tmp/argus-docs
- name: Verify site builds
run: cd /tmp/argus-docs && mkdocs build --strict --site-dir /tmp/site
- name: Configure git for mike
if: github.event_name == 'release'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy versioned docs
if: github.event_name == 'release'
run: |
VERSION=$(head -1 version.yaml | awk '{print $1}')
mike deploy --push --update-aliases "$VERSION" latest \
--config-file /tmp/argus-docs/mkdocs.yml
mike set-default --push latest \
--config-file /tmp/argus-docs/mkdocs.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}