Create html web documentation #32
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create html web documentation | |
on: | |
release: | |
types: | |
- created | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Miniconda | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
python-version: 3.12 | |
channels: conda-forge | |
auto-update-conda: true | |
miniconda-version: "latest" | |
activate-environment: docs | |
- name: Set up Conda environment | |
shell: bash -l {0} | |
run: | | |
conda config --set always_yes yes --set changeps1 no | |
conda install -q -n docs python=3.12 \ | |
pip \ | |
twine\ | |
setuptools \ | |
pypandoc \ | |
sphinx \ | |
sphinx_rtd_theme \ | |
pyshtools | |
conda list -n docs | |
- name: Build ctplanet using pip | |
shell: bash -l {0} | |
run: | | |
conda env list | |
pip install --no-deps . | |
- name: Build the sphinx documentation | |
shell: bash -l {0} | |
run: | | |
cd docs | |
make html | |
- name: Upload artifact of the html output | |
uses: actions/upload-artifact@v4 | |
with: | |
name: gh-pages-documentation | |
path: docs/_build/html/ | |
retention-days: 1 | |
- name: Clean gh-pages branch | |
shell: bash -l {0} | |
run: | | |
git switch gh-pages | |
git clean -fd | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: gh-pages-documentation | |
- name: Commit changes | |
shell: bash -l {0} | |
run: | | |
git add . | |
git commit -m "Update gh-pages documenation" -a || true | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
branch: gh-pages | |
github_token: ${{ secrets.GITHUB_TOKEN }} |