-
Notifications
You must be signed in to change notification settings - Fork 2
64 lines (59 loc) · 1.95 KB
/
build-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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Publish Docs On Change
on:
workflow_dispatch:
push:
branches: [ main, master]
jobs:
build:
name: Deploy docs
runs-on: ubuntu-latest
defaults:
run:
shell: bash -x -l {0}
steps:
- name: Checkout main
uses: actions/checkout@v4
- name: Setup miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: mkdocs
auto-activate-base: false
- name: Setup Docs Environment
env:
MKDOCS_INSIDERS: ${{ secrets.MKDOCS_INSIDERS }}
run: |
# Conda dependencies
conda install -c conda-forge jq 'python>3.6'
# MkDocs dependencies
pip install \
"cairosvg>=2.5" \
"mkdocs-git-committers-plugin-2<1" \
"mkdocs-git-revision-date-localized-plugin>=1.0" \
"mkdocs-minify-plugin>=0.3" \
"mkdocs-rss-plugin>=1.1" \
"mkdocs-redirects>=1.0" \
"mkdocstrings[python]>=0.18" \
mkdocs-gen-files \
"pillow<10" \
mike
# MkDocs Insiders
pip install \
git+https://${MKDOCS_INSIDERS}@github.com/rpetit3/mkdocs-material-insiders.git
mkdocs --version
- name: Deploy Docs
run: |
git fetch origin gh-pages --depth=1
git config user.name "GitHub Actions"
git config user.email [email protected]
LATEST_RELEASE=$(curl -sL https://api.github.com/repos/rpetit3/camlhmp/releases/latest | jq -r ".tag_name")
echo ${LATEST_RELEASE}
ls -lha
mike deploy --push --update-aliases ${LATEST_RELEASE} latest
mike set-default --push latest
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
message: "ci - auto build from camlhmp"
committer_name: GitHub Actions
committer_email: [email protected]
add: 'mkdocs.yml docs/'