website #23
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: website | |
on: | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
python-doc: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.11" | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install poetry | |
poetry install | |
- name: Install latest public version of constriction from pypi | |
run: | | |
CONSTRICTION_VERSION=`poetry run python get_version.py` | |
echo "Found constriction version $CONSTRICTION_VERSION." | |
poetry run pip install constriction==$CONSTRICTION_VERSION | |
poetry run pytest tests/python | |
- name: checkout website template | |
run: | | |
git clone https://github.com/bamler-lab/constriction.git --branch website-template --single-branch website | |
rm -rf website/.git | |
CONSTRICTION_VERSION=`poetry run python get_version.py` | |
echo "Found constriction version $CONSTRICTION_VERSION." | |
sed -i "s/<\!-- CONSTRICTION_VERSION -->/$CONSTRICTION_VERSION/g" website/index.html | |
- name: Download license file | |
run: | | |
wget -P website https://bamler-lab.github.io/constriction/license.html | |
ls -l website/license.html | |
wc -l website/license.html | |
- name: generate python API reference | |
run: | | |
poetry run python pythondoc.py website/apidoc/python | |
mv website/apidoc/python/constriction/* website/apidoc/python/ | |
rmdir website/apidoc/python/constriction | |
- name: Save artifact with website | |
uses: actions/upload-artifact@v2 | |
with: | |
name: website | |
path: ./website | |
- name: Deploy website to gh-pages branch | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./website | |
commit_message: Deploy |