|
| 1 | +name: ActivitySim Branch Docs |
| 2 | +# This workflow is provided as a service for forks to build branch-specific documentation. |
| 3 | + |
| 4 | +on: push |
| 5 | + |
| 6 | +jobs: |
| 7 | + docbuild: |
| 8 | + if: "contains(github.event.head_commit.message, '[makedocs]') && (github.repository_owner != 'ActivitySim') && (github.ref_name != 'develop')" |
| 9 | + # develop branch docs are built at the end of the core test workflow, regardless of repository owner or commit message flags |
| 10 | + name: ubuntu-latest py3.9 |
| 11 | + runs-on: ubuntu-latest |
| 12 | + defaults: |
| 13 | + run: |
| 14 | + shell: bash -l {0} |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v3 |
| 17 | + with: |
| 18 | + fetch-depth: 0 # get all tags, lets setuptools_scm do its thing |
| 19 | + - name: Set up Python 3.9 |
| 20 | + uses: actions/setup-python@v2 |
| 21 | + with: |
| 22 | + python-version: 3.9 |
| 23 | + - name: Install dependencies |
| 24 | + uses: conda-incubator/setup-miniconda@v2 |
| 25 | + with: |
| 26 | + miniforge-variant: Mambaforge |
| 27 | + miniforge-version: latest |
| 28 | + use-mamba: true |
| 29 | + environment-file: conda-environments/docbuild.yml |
| 30 | + python-version: 3.9 |
| 31 | + activate-environment: docbuild |
| 32 | + auto-activate-base: false |
| 33 | + auto-update-conda: false |
| 34 | + - name: Install activitysim |
| 35 | + run: | |
| 36 | + python -m pip install . |
| 37 | + - name: Conda checkup |
| 38 | + run: | |
| 39 | + conda info -a |
| 40 | + conda list |
| 41 | + echo REPOSITORY ${{ github.repository }} |
| 42 | + echo REF ${{ github.ref }} |
| 43 | + echo REF_NAME ${{ github.ref_name }} |
| 44 | + - name: Build the docs |
| 45 | + run: | |
| 46 | + cd docs |
| 47 | + make clean |
| 48 | + make html |
| 49 | + - name: Push to GitHub Pages |
| 50 | + uses: peaceiris/actions-gh-pages@v3.8.0 |
| 51 | + with: |
| 52 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 53 | + # Token is created automatically by Github Actions, no other config needed |
| 54 | + publish_dir: ./docs/_build/html |
| 55 | + destination_dir: ${{ github.ref_name }} |
0 commit comments