-
Notifications
You must be signed in to change notification settings - Fork 74
66 lines (50 loc) · 1.76 KB
/
publish_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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Publish Docs
on:
push:
branches:
- main
release:
types: [published]
env:
TAG: ${{ github.event.release.tag_name }}
PROD_PUBLISH: true
jobs:
publish_docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Echo the Release Tag
run: echo ${{ env.TAG }}
- name: Install Nox
run: pip install nox>=2022
- name: Install Docs Requirements
run: pip install -r docs/fides/requirements.txt
- name: Install fides
run: pip install -e ./[all]
- name: Checkout the gh-pages branches
run: git fetch origin gh-pages --depth=1
- name: Build docs
run: nox -s generate_docs
# This is required by "mike"
- name: Set the Git Username & Email
run: |
git config user.name github-actions
git config user.email [email protected]
# Deploys docs without a version in the URL for legacy links
# This will match the "stable" version of the versioned docs
- name: Deploy the Legacy Docs if a Release is Published
if: ${{ env.TAG }}
run: mkdocs gh-deploy -v -f docs/fides/mkdocs.yml --force
- name: Deploy Stable Docs if a Release is Published
if: ${{ env.TAG }}
run: mike deploy --config-file docs/fides/mkdocs.yml --push --update-aliases ${{ env.TAG }} stable
# This will match "stable" when a new release is cut
- name: Deploy Dev Docs
run: mike deploy --config-file docs/fides/mkdocs.yml --push dev
- name: Set Default Version
run: mike set-default --config-file docs/fides/mkdocs.yml --push stable