-
Notifications
You must be signed in to change notification settings - Fork 19
49 lines (41 loc) · 1.25 KB
/
version-docs.yml
File metadata and controls
49 lines (41 loc) · 1.25 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
name: Deploy Versioned Docs with Mike
on:
push:
tags:
- 'v*'
branches:
- main
permissions:
contents: write # Required to push to gh-pages
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0 # To fetch tags
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
pip install mike mkdocs #sphinx
- name: Configure Git (for mike to push)
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
- name: Deploy docs
run: |
#export CASSIOPEE=$GITHUB_WORKSPACE
#cd $CASSIOPEE/Cassiopee
#./install --doc
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
mike deploy --push --update-aliases "$VERSION" latest
else
VERSION=current
mike deploy --push "$VERSION"
fi