Skip to content

Commit

Permalink
Add documentation and auto-deploy (#3)
Browse files Browse the repository at this point in the history
* deploy docs on tag

* deploy docs on tag

* deploy to pypi

* echo

* run on tags

* fix link

* use correct shell

* clean up doc generation

* ruamel.yaml
  • Loading branch information
jpn-- authored Feb 19, 2022
1 parent f1a076a commit 66d5123
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 3 deletions.
64 changes: 63 additions & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ name: sharrow testing
on:
push:
branches: [ main ]
tags:
- 'v[0-9]+.[0-9]+**'
pull_request:
branches: [ main ]
tags:
- 'v[0-9]+.[0-9]+**'

jobs:
build:
test:
name: ${{ matrix.os }} py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
Expand Down Expand Up @@ -50,3 +54,61 @@ jobs:
- name: Test with pytest
run: |
python -m pytest
deploy-docs:
needs: test
# only on pushes tagged with v...
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- 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: envs/testing.yml
python-version: 3.9
activate-environment: testing-env
auto-activate-base: false
auto-update-conda: false
- name: Install Jupyterbook and ruamel.yaml
run: |
mamba install jupyter-book ruamel.yaml -c conda-forge
- name: Install sharrow
run: |
python -m pip install --no-deps -e .
- name: Conda checkup
run: |
conda info -a
conda list
- name: Build the docs
run: |
python docs/_script/run_all.py
jupyter-book build ./docs
- name: Push to GitHub Pages
uses: peaceiris/actions-gh-pages@v3.5.9
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Token is created automatically by Github Actions, no other config needed
publish_dir: ./docs/_build/html
# now send to PyPI
- name: Install pip build
run: |
python -m pip install --upgrade build
- name: Build wheel
run: |
python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
2 changes: 1 addition & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Book settings
# Learn more at https://jupyterbook.org/customize/config.html

title: v2022.0.1
title: sharrow docs
author: Sharrow contributors, for the <a href="https://activitysim.github.io/">ActivitySim
Consortium</a>
logo: logo.png
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = sharrow
author = Cambridge Systematics
author_email = jeffnewman@camsys.com
license = BSD-3-Clause
url = https://github.com/camsys/sharrow
url = https://github.com/ActivitySim/sharrow

[options]
packages = find:
Expand Down

0 comments on commit 66d5123

Please sign in to comment.