-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
62 lines (62 loc) · 2.09 KB
/
action.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: "mkdocs-mike"
description: "Deploy documentation to github pages using mkdocs + mike"
author: "Kelly Sovacool"
inputs:
github-token:
description: "GitHub Actions token (e.g. { github.token })"
required: true
ccbr-actions-version:
description: "The version of ccbr_actions to install"
required: true
default: "main"
python-version:
description: "The version of Python to install"
required: true
default: "3.11"
docs-branch:
description: "The branch to deploy the docs website to"
required: true
default: "gh-pages"
github-actor:
description: "Username of GitHub actor for the git commit when the docs branch is deployed"
required: true
default: "41898282+github-actions[bot]"
outputs:
version:
description: "The version of the docs being deployed."
value: ${{ steps.set-version.outputs.version }}
alias:
description: "The alias of the version being deployed."
value: ${{ steps.set-version.outputs.alias }}
runs:
using: "composite"
steps:
- uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
cache: pip
- name: git config
shell: bash
run: |
git config --local user.email "${{ inputs.github-actor }}@users.noreply.github.com"
git config --local user.name "${{ inputs.github-actor }}"
- name: pip install
shell: bash
run: |
pip install --upgrade pip git+https://github.com/CCBR/actions.git@${{ inputs.ccbr-actions-version }}
if [ -f docs/requirements.txt ]; then pip install -r docs/requirements.txt; fi
- name: set version tag & alias for mike
id: set-version
shell: python {0}
run: |
from ccbr_actions.docs import set_docs_version
set_docs_version() # sets VERSION and ALIAS env vars
env:
GH_TOKEN: ${{ inputs.github-token }}
- name: deploy docs
shell: bash
run: |
mike deploy ${{ steps.set-version.outputs.version }} ${{ steps.set-version.outputs.alias }} \
--push \
--update-aliases \
--branch ${{ inputs.docs-branch }}