-
Notifications
You must be signed in to change notification settings - Fork 34
42 lines (40 loc) · 1.4 KB
/
deploy.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
name: deploy
on:
push:
branches:
- main
- stable
paths-ignore:
- '.gitignore'
- 'readme_images/**'
- '*.md'
jobs:
build:
name: 'Deploy docs'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip'
- name: 'Install Python packages'
run: pip install -r requirements.txt
- name: 'Prepare Git'
run: |
remote_repo="https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git remote rm origin
git remote add origin "${remote_repo}"
git fetch origin gh-pages --depth=1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 'Read version number'
run: echo "APP_VERSION=$(cat VERSION)" >> $GITHUB_ENV
- name: 'Deploy documentation for beta version'
if: github.ref_name == 'main'
run: mike deploy --push --config-file config/en/mkdocs.yml --prefix en/ --title "${APP_VERSION} (beta)" beta
- name: 'Deploy documentation for stable version'
if: github.ref_name == 'stable'
run: mike deploy --push --config-file config/en/mkdocs.yml --prefix en/ --update-aliases ${APP_VERSION} current