Skip to content

Commit

Permalink
Merge pull request #199 from jGaboardi/implement_gha_docs
Browse files Browse the repository at this point in the history
Implement GHA for building docs
  • Loading branch information
weikang9009 authored Sep 23, 2023
2 parents bca21de + 0d28a37 commit 92e3bbb
Show file tree
Hide file tree
Showing 261 changed files with 1,844 additions and 67,604 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Build Docs

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
workflow_dispatch:
inputs:
version:
description: Manual Doc Build
default: test
required: false
jobs:
docs:
name: build & push docs
runs-on: ${{ matrix.os }}
timeout-minutes: 90
strategy:
matrix:
os: ['ubuntu-latest']
environment-file: [ci/311.yaml]
experimental: [false]
defaults:
run:
shell: bash -l {0}

steps:
- name: checkout repo
uses: actions/checkout@v4

- name: setup micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ${{ matrix.environment-file }}
micromamba-version: 'latest'

- name: reinstall for version
run: |
pip install -e . --no-deps --force-reinstall
- name: make docs
run: |
cd docs
make html
- name: commit docs
run: |
git clone https://github.com/ammaraskar/sphinx-action-test.git --branch gh-pages --single-branch gh-pages
cp -r docs/_build/html/* gh-pages/
cd gh-pages
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Update documentation" -a || true
# The above command will fail if no changes were present,
# so we ignore the return code.
- name: push to gh-pages
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
force: true
6 changes: 6 additions & 0 deletions ci/311.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@ dependencies:
- pytest
- pytest-cov
- pytest-xdist
# docs (this env only)
- nbsphinx
- numpydoc
- sphinx>=1.4.3
- sphinxcontrib-bibtex
- sphinx_bootstrap_theme
4 changes: 0 additions & 4 deletions docs/.buildinfo

This file was deleted.

2 changes: 1 addition & 1 deletion docs/.nojekyll
Original file line number Diff line number Diff line change
@@ -1 +1 @@

Loading

0 comments on commit 92e3bbb

Please sign in to comment.