-
Notifications
You must be signed in to change notification settings - Fork 812
44 lines (38 loc) · 1.25 KB
/
mkdocs-publish.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
name: Publish branch
on:
push:
branches:
- "release-*"
paths:
- 'docs/**'
- '**.md'
- 'mkdocs.yml'
jobs:
upload:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: "3.9"
- run: pip install mkdocs-material mkdocs-static-i18n mike mkdocs-same-dir
- name: Set user
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Mike with updating aliases
if: ${{ github.event.created }}
run: |
echo ${{ steps.extract_branch.outputs.branch }}
mike deploy --push --force --no-redirect --update-aliases ${{ steps.extract_branch.outputs.branch }} latest --rebase
- name: Mike
if: ${{ !github.event.created }}
run: |
echo ${{ steps.extract_branch.outputs.branch }}
mike deploy --force --push ${{ steps.extract_branch.outputs.branch }}