-
Notifications
You must be signed in to change notification settings - Fork 14
66 lines (63 loc) · 2 KB
/
deploy_latest.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
name: Deploy Release Docs
on:
push:
tags:
- "**"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
# See: https://github.com/pdm-project/pdm/issues/1879
env:
PDM_DEPS: 'urllib3<2'
jobs:
documentation:
name: Deploy release documentation
runs-on: ubuntu-latest
steps:
- name: Wait for dev documentation to deploy
uses: lewagon/wait-on-check-action@v1.3.4
with:
ref: main
check-name: 'Deploy dev documentation'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- uses: pdm-project/setup-pdm@v4
name: Setup PDM
with:
python-version: 3.12
- name: Install dependencies
run: pdm install -G doc
- name: Set up build cache
uses: actions/cache@v4
id: cache
with:
key: mkdocs-material-${{ github.ref }}
path: .cache
restore-keys: |
mkdocs-material-
# derived from:
# https://github.com/RemoteCloud/public-documentation/blob/dev/.github/workflows/build_docs.yml
- name: Configure Git user
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Set release notes tag
run: |
export TAG_PATH=${{ github.ref }}
echo ${TAG_PATH}
echo "TAG_VERSION=${TAG_PATH##*/}" >> $GITHUB_ENV
echo ${TAG_VERSION}
- name: Deploy documentation
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }}
run: |
git fetch origin gh-pages --depth=1
pdm run mike deploy --update-alias --push ${TAG_VERSION} latest