Skip to content

Commit 4ab932c

Browse files
committed
add docs action
1 parent ea86611 commit 4ab932c

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

.github/workflows/build_docs.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
2+
name: Build Docs
3+
on:
4+
push:
5+
branches:
6+
- main
7+
jobs:
8+
docs:
9+
name: Build & Push Docs
10+
runs-on: ${{ matrix.os }}
11+
timeout-minutes: 90
12+
strategy:
13+
matrix:
14+
os: ['ubuntu-latest']
15+
environment-file: [ci/38.yaml]
16+
experimental: [false]
17+
defaults:
18+
run:
19+
shell: bash -l {0}
20+
steps:
21+
- uses: actions/checkout@v2
22+
- uses: actions/cache@v2
23+
env:
24+
CACHE_NUMBER: 0
25+
with:
26+
path: ~/conda_pkgs_dir
27+
key: ${{ matrix.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles(matrix.environment-file) }}
28+
- uses: conda-incubator/setup-miniconda@v2
29+
with:
30+
miniconda-version: 'latest'
31+
mamba-version: '*'
32+
channels: conda-forge
33+
channel-priority: true
34+
auto-update-conda: false
35+
auto-activate-base: false
36+
environment-file: ${{ matrix.environment-file }}
37+
activate-environment: test
38+
use-only-tar-bz2: true
39+
- run: mamba info --all
40+
- run: mamba list
41+
- run: conda config --show-sources
42+
- run: conda config --show
43+
- name: Make Docs
44+
run: cd docs; make html
45+
- name: Commit Docs
46+
run: |
47+
git clone https://github.com/ammaraskar/sphinx-action-test.git --branch gh-pages --single-branch gh-pages
48+
cp -r docs/_build/html/* gh-pages/
49+
cd gh-pages
50+
git config --local user.email "[email protected]"
51+
git config --local user.name "GitHub Action"
52+
git add .
53+
git commit -m "Update documentation" -a || true
54+
# The above command will fail if no changes were present,
55+
# so we ignore the return code.
56+
- uses: ad-m/github-push-action@master
57+
with:
58+
branch: gh-pages
59+
directory: gh-pages
60+
github_token: ${{ secrets.GITHUB_TOKEN }}
61+
force: true

0 commit comments

Comments
 (0)