Skip to content

ASHRAE Guideline 36, Section 4 #702

ASHRAE Guideline 36, Section 4

ASHRAE Guideline 36, Section 4 #702

Workflow file for this run

name: continuous deployment
on:
pull_request:
branches:
- develop
- main
push:
branches:
- develop
- main
release:
jobs:
# deploy docs for develop and main branches
deploy-docs:
runs-on: ubuntu-latest
steps:
# setup, checkout pull_request.head.ref for repo-vis
- name: checkout
uses: actions/checkout@v4
with:
ref: ${{github.event.pull_request.head.ref}}
- name: setup-python
uses: actions/setup-python@v5
with:
python-version: '3.11'
# # update repo visualization for docs
# - name: repo-visualizer
# uses: githubocto/repo-visualizer@0.8.2
# with:
# output_file: docs/reference/apidoc/code_visualization.svg
# excluded_paths: ".github"
# commit_message: "repo-visualizer [skip actions]"
# install project, which is required for autodoc of code
- name: install-poetry
uses: snok/install-poetry@v1
with:
version: 1.4.0
virtualenvs-create: false
- name: install buildingmotif
run: poetry install --all-extras
# install jupyter-book, which for some reason isn't available with poetry install
- name: install jupyter book
run: pip install jupyter-book
# build docs, which are deployed by repo settings
- name: build docs
run: |
jupyter-book config sphinx ./docs/
sphinx-build ./docs/ docs/_build/html -b html
# TODO can we use an official GitHub Action? https://github.com/actions/deploy-pages
- name: deploy docs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html
# deploy distribution if a new release and tag are created
deploy-dist:
needs: deploy-docs
if: startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
# setup
- name: checkout
uses: actions/checkout@v4
- name: setup-python
uses: actions/setup-python@v5
# install poetry and build dist
- name: install-poetry
uses: snok/install-poetry@v1
with:
version: 1.4.0
virtualenvs-in-project: false
virtualenvs-path: ~/.virtualenvs
- name: build dist
run: poetry build
- name: publish distribution to Test PyPI
id: test-pypi
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
- name: publish distribution to PyPI
if: steps.test-pypi.outcome == 'success'
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}