-
Notifications
You must be signed in to change notification settings - Fork 421
71 lines (67 loc) · 2.37 KB
/
python_docs.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
64
65
66
67
68
69
70
71
name: Docs
# Maintenance: Create a reusable workflow to be more easily reused across release, push, and doc hot fixes
# this should include inputs on whether to release API docs, what version to release, and whether to rebuild /latest
on:
push:
branches:
- develop
paths:
- "docs/**"
- "mkdocs.yml"
- "examples/**"
workflow_dispatch:
jobs:
changelog:
permissions:
contents: write
uses: ./.github/workflows/reusable_publish_changelog.yml
docs:
needs: changelog
# Force Github action to run only a single job at a time (based on the group name)
# This is to prevent "race-condition" in publishing a new version of doc to `gh-pages`
concurrency:
group: on-docs-build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
cache: "poetry"
# Maintenance: temporarily until we drop Python 3.6 and make cfn-lint a dev dependency
- name: Setup Cloud Formation Linter with Latest Version
uses: scottbrenner/cfn-lint-action@ee9ee62016ef62c5fd366e6be920df4b310ed353 # v2.2.4
- name: Install dependencies
run: make dev
- name: Lint documentation
run: |
make lint-docs
cfn-lint examples/**/*.yaml
- name: Setup doc deploy
run: |
git config --global user.name Docs deploy
git config --global user.email [email protected]
git config pull.rebase true
git pull --rebase
- name: Build docs website and API reference
run: make release-docs VERSION="develop" ALIAS="stage"
- name: Deploy all docs
uses: peaceiris/actions-gh-pages@068dc23d9710f1ba62e86896f84735d869951305 # v3.8.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./api
keep_files: true
destination_dir: develop/api
- name: Create redirect from old docs
run: |
git checkout gh-pages
test -f 404.html && echo "Redirect already set" && exit 0
git checkout develop -- 404.html
git add 404.html
git commit -m "chore: set docs redirect" --no-verify
git push origin gh-pages -f