-
Notifications
You must be signed in to change notification settings - Fork 16
75 lines (63 loc) · 2.03 KB
/
deploy-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
65
66
67
68
69
70
71
72
73
74
75
# Preamble
name: Deploy SaltProc docs
on:
push:
branches:
- 'master'
paths:
- 'doc/**'
- 'saltproc/**'
# enable worflow to be run manually
workflow_dispatch:
env:
CACHE_NUMBER: 0 #change to manually reset cache
jobs:
deploy-docs:
runs-on: ubuntu-latest
#if: ${{ github.event.workflow_run.conclusion == 'success' }}
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
# Setup conda
- name: Set up conda
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge # mamba is faster than base conda
miniforge-version: latest
activate-environment: saltproc-doc-env
use-mamba: true
use-only-tar-bz2: true
- run: |
conda config --env --set pip_interop_enabled True
# check for existing cache
- name: Set cache date
run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
- uses: actions/cache@v2
id: dependencies-cache
with:
path: |
/usr/share/miniconda3/envs/saltproc-doc-env
~/.cache/pip
key: depcache-${{ hashFiles('doc/doc-environment.yml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }}
# Install dependencies
- name: Update environment
run: mamba env update -n saltproc-doc-env -f doc/doc-environment.yml
if: steps.dependencies-cache.outputs.cache-hit != 'true'
- name: Install SaltProc
run: pip install .
- name: Check packages
run: conda list
- name: Build Sphinx Documentation
run: |
sphinx-multiversion doc doc/_build/html
cp doc/redirect.html doc/_build/html/index.html
- name: Deploy documentation to gh-pages branch
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./doc/_build/html
commit_message: "update docs at commit: ${{ github.event.head_commit.message }}"