-
Notifications
You must be signed in to change notification settings - Fork 22
47 lines (38 loc) · 1.31 KB
/
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
name: Deploy documentation
on:
workflow_call:
env:
python-version: 'pypy3.10'
jobs:
deploy-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: ${{ env.python-version }}
- name: Install dependicies
run: pip install -r requirements.txt
- name: Setup docs deploy
run: |
git config --global user.name "Greenmask CI"
git config --global user.email ci@greenmask.io
- name: Build dev docs
if: github.ref == 'refs/heads/main'
run: mike deploy --push dev
- name: Get Git tag
if: startsWith(github.ref, 'refs/tags/v')
run: echo "TAG=$(git tag --points-at HEAD)" >> $GITHUB_ENV
- name: Build release docs
if: startsWith(github.ref, 'refs/tags/v')
run: |
if [[ "${{ env.TAG }}" == *"rc"* || "${{ env.TAG }}" == *"dev"* || "${{ env.TAG }}" == *"pre"* || "${{ env.TAG }}" == *"beta"* || "${{ env.TAG }}" == *"b"* ]]; then
mike deploy --push ${{ env.TAG }}
else
mike deploy --push --update-aliases ${{ env.TAG }} latest
mike set-default --push latest
fi