Skip to content

CI: Try picking out the correct branch for linking to source code. #2

CI: Try picking out the correct branch for linking to source code.

CI: Try picking out the correct branch for linking to source code. #2

Workflow file for this run

name: Docs Pages Deployment CI
on:
push:
branches: [ main, test-docs-deployment ]
workflow_dispatch:
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install -v ".[test]"
python -m pip install ruff==0.13.1
python -m pip install -r .github/constraints/deps.txt
- name: lint
run: |
ruff check
- name: lint and build docs
run: |
numpydoc lint src/gfdl/model.py src/gfdl/activations.py src/gfdl/weights.py
cd docs && make html SPHINXOPTS="-W --keep-going"
- name: test
run: |
cd $RUNNER_TEMP
python -m pytest --pyargs gfdl --cov=gfdl --cov-report=term-missing
# needed for pages deployment from the main or the deployment test branch
- name: upload pages artifacts
uses: actions/upload-pages-artifact@v3
with:
path: docs/build/html
# deploy for push events on the main or deployment test branch
deploy:
runs-on: ubuntu-latest
needs: build-docs
permissions:
pages: write
id-token: write
environment:
name: github-pages
steps:
- uses: actions/deploy-pages@v4