-
Notifications
You must be signed in to change notification settings - Fork 10
50 lines (47 loc) · 1.55 KB
/
publish-docs.yaml
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: Publish documentation
on:
workflow_dispatch:
inputs:
ref:
description: The branch, tag or SHA to deploy
required: true
version:
description: Version to be deployed
required: false
permissions: {}
jobs:
deploy:
name: Publish documentation
runs-on: ubuntu-20.04
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.ref }}
fetch-depth: 0
persist-credentials: true
- uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install dependencies
run: |
pip install -r docs/build/requirements.txt
- name: Configure the git user
run: |
git config user.name "devopstales-bot"
git config user.email "[email protected]"
- name: Deploy the latest documents from new tag push
if: ${{ github.event.inputs.version == '' }}
run: |
VERSION=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g")
mike deploy --push $VERSION
mike deploy --push --update-aliases $VERSION latest
mike set-default --push latest
- name: Deploy the latest documents from manual trigger
if: ${{ github.event.inputs.version != '' }}
run: |
mike deploy --push ${{ github.event.inputs.version }}
mike deploy --push --update-aliases ${{ github.event.inputs.version }} latest
mike set-default --push latest