Skip to content

Commit

Permalink
auto-build docs on release
Browse files Browse the repository at this point in the history
  • Loading branch information
jpn-- committed Sep 13, 2022
1 parent 645b3e4 commit fe65ce4
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 2 deletions.
53 changes: 52 additions & 1 deletion .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,57 @@ jobs:
repository_url: https://test.pypi.org/legacy/
verbose: true

docbuild:
needs: test-built-dist
if: github.event_name == 'release'
name: ubuntu-latest py3.9
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/download-artifact@v3
with:
name: releases
path: dist
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true
environment-file: conda-environments/docbuild.yml
python-version: 3.9
activate-environment: docbuild
auto-activate-base: false
auto-update-conda: false
- name: Install activitysim
run: |
python -m pip install dist/activitysim-*.whl
- name: Conda checkup
run: |
conda info -a
conda list
echo REPOSITORY ${{ github.repository }}
echo REF ${{ github.ref }}
echo REF_NAME ${{ github.ref_name }}
- name: Build the docs
run: |
cd docs
make clean
make html
- name: Push to GitHub Pages
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Token is created automatically by Github Actions, no other config needed
publish_dir: ./docs/_build/html
destination_dir: ${{ github.ref_name }}

upload-to-pypi:
needs: test-built-dist
if: github.event_name == 'release'
Expand All @@ -89,4 +140,4 @@ jobs:
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
verbose: true
verbose: true
4 changes: 4 additions & 0 deletions HOW_TO_RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,7 @@
conda deactivate
conda env remove -n TEMP-ASIM-DEV
```
00. Change the default redirect page for the ActivitySim documentation to point
to the newly released documentation. The redirect page can be edited
[here](https://github.com/ActivitySim/activitysim/blob/gh-pages/index.html).
8 changes: 7 additions & 1 deletion conda-environments/docbuild.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# Environment for building docs
#
# This conda environment is used to build the documentation. It includes a
# number of dependencies needed for the documentation only, and not to run or
# test ActivitySim itself. Note that ActivitySim itself is *not* installed
# in this environment, you must install it separately after using this recipe,
# which allows you to install the specific version you want.

name: docbuild
channels:
- conda-forge
Expand Down Expand Up @@ -43,4 +50,3 @@ dependencies:

- pip:
- autodoc_pydantic
- -e ..

0 comments on commit fe65ce4

Please sign in to comment.