-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (41 loc) · 1.62 KB
/
docs.yml
File metadata and controls
50 lines (41 loc) · 1.62 KB
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
name: Deploy cetk-cli Documentation
on:
push:
branches:
- main
- develop
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install MkDocs
run: |
pip install mkdocs-material
pip install mkdocs-autorefs mkdocs-include-markdown-plugin pymdown-extensions mike
- name: Read version from file
if: github.ref == 'refs/heads/main'
run: echo "CETK_CLI_VERSION=$(cat VERSION)" >> $GITHUB_ENV
- name: Fetch gh-pages branch
run: |
git fetch origin gh-pages:gh-pages
- name: Deploy Release Doc to GitHub Pages
if: github.ref == 'refs/heads/main'
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
mike deploy --branch gh-pages $CETK_CLI_VERSION latest --push --update-aliases
mike set-default --branch gh-pages latest --push
- name: Deploy Unstable Doc to Github Pages
if: github.ref == 'refs/heads/develop'
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
mike deploy --branch gh-pages unstable --push
mike list --branch gh-pages | grep -q "latest" || mike alias --branch gh-pages unstable latest --push
mike set-default --branch gh-pages latest --push