Skip to content

Docs

Docs #89

Workflow file for this run

# Build documentation
# See https://github.com/actions/starter-workflows/blob/main/pages/static.yml for starter
# https://github.com/actions/starter-workflows/tree/main/pages
#
# Currently hosted at https://py.contrails.org
name: Docs
# only build docs on release tags
on:
push:
tags:
- '*'
# Allows run manually from the Actions tab
workflow_dispatch:
# disable all permissions at the top level
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
permissions: {}
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: OS Dependencies
run: sudo apt-get install -y pandoc
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Remove any .dev suffix from the version
# This is useful when running between tags from a workflow-dispatch
- name: Get the pycontrails version
id: get_version
run: echo "version=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT
- uses: actions/setup-python@v5
with:
python-version: '3.13'
cache: pip
cache-dependency-path: pyproject.toml
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT }}
- name: Install pycontrails (dev)
run: make dev-install
env:
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYCONTRAILS: ${{ steps.get_version.outputs.version }}
# https://cloud.google.com/artifact-registry/docs/python/authentication
- name: Install latest pycontrails-bada
run: |
pip install keyring keyrings.google-artifactregistry-auth
pip install -U -i https://us-central1-python.pkg.dev/contrails-301217/pycontrails/simple pycontrails-bada
# TODO: Execute notebooks for docs
# - name: Execute notebooks
# run: |
# make nb-execute
- name: Build docs
run: |
make docs-build
ls -la docs/_build/html
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'docs/_build/html/'
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4