-
Notifications
You must be signed in to change notification settings - Fork 421
62 lines (57 loc) · 2.04 KB
/
rebuild_latest_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
name: Rebuild latest docs
#
# === Documentation hotfix ===
#
# 1. Trigger "Rebuild latest docs" workflow manually: https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
# 2. Use the latest version released under Releases e.g. v1.22.0
# 3. Set `Build and publish docs only` field to `true`
on:
workflow_dispatch:
inputs:
latest_published_version:
description: 'Latest PyPi published version to rebuild latest docs for, e.g. v1.22.0'
default: 'v1.22.0'
required: true
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/[email protected]
with:
python-version: "3.8"
- name: Set release notes tag
run: |
RELEASE_TAG_VERSION=${{ github.event.inputs.latest_published_version }}
echo "RELEASE_TAG_VERSION=${RELEASE_TAG_VERSION:1}" >> $GITHUB_ENV
- name: Ensure new version is also set in pyproject and CHANGELOG
run: |
grep --regexp "${RELEASE_TAG_VERSION}" CHANGELOG.md
grep --regexp "version \= \"${RELEASE_TAG_VERSION}\"" pyproject.toml
- name: Install dependencies
run: make dev
- name: Setup doc deploy
run: |
git config --global user.name Docs deploy
git config --global user.email [email protected]
- name: Build docs website and API reference
run: |
make release-docs VERSION=${RELEASE_TAG_VERSION} ALIAS="latest"
poetry run mike set-default --push latest
- name: Release API docs to release version
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./api
keep_files: true
destination_dir: ${{ env.RELEASE_TAG_VERSION }}/api
- name: Release API docs to latest
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./api
keep_files: true
destination_dir: latest/api