-
Notifications
You must be signed in to change notification settings - Fork 20
68 lines (58 loc) · 1.79 KB
/
deploy.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
63
64
65
66
67
68
name: deploy
on:
push:
branches:
- main
release:
types:
- published
env:
PYTHON_VERSION: 3.11
permissions:
contents: write
jobs:
build_site:
name: Build Site
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python runtime
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Set up build cache
uses: actions/cache@v3
id: cache
with:
key: ${{ runner.os }}-${{ hashFiles('.cache/**') }}
path: .cache
- name: Install Python dependencies
run: |
pip install -r requirements.txt
- if: github.event_name == 'release' && github.event.action == 'published'
name: Deploy site
run: |
mkdocs --version
#mkdocs gh-deploy --force
mike --version
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git config --global user.name "${{ github.actor }}"
mike deploy --push --template go-import/redirect.html --update-aliases ${{ github.event.release.tag_name }} latest zot
mike set-default --push latest
- if: github.event_name == 'release' && github.event.action == 'published'
name: Build PDF document
run: |
mkdocs --version
mkdocs build
- if: github.event_name == 'release' && github.event.action == 'published'
name: Publish artifacts on releases
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: site/pdf/document.pdf
tag: ${{ github.ref }}
overwrite: true
file_glob: true