Skip to content

Commit

Permalink
Update documentation workflow to use cached python libraries.
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewHambley committed May 1, 2024
1 parent 96a9c57 commit ad488c1
Showing 1 changed file with 42 additions and 30 deletions.
72 changes: 42 additions & 30 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,47 @@ on: workflow_dispatch
jobs:
build-docs:

runs-on: ubuntu-latest
runs-on: ubuntu-24.04

steps:
- name: set git user
run: |
git config --global user.email "metomi@metoffice.gov.uk"
git config --global user.name "SciFab Developers"
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: install fab
run: pip install .[docs]
- name: build docs
run: |
cd docs
rm -rf build
sphinx-apidoc --separate --module-first -d 5 -f -o source/apidoc ../source/fab
make html
- name: move built docs to docs root
run: |
mv docs/build/html/* docs/
- name: git add built docs
run: |
git add docs/*
- name: commit
run: |
git commit -m "docs build"
- name: push to gh_pages branch
run: |
echo "pushing from $GITHUB_REF_NAME to gh_pages"
git push --force origin $GITHUB_REF_NAME:gh_pages
- name: set git user
run: |
git config --global user.email "metomi@metoffice.gov.uk"
git config --global user.name "SciFab Developers"
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
cache: pip

- name: Install Python libraries
run: |
python -m pip install --upgrade pip
pip install -e .[docs]
- name: build docs
run: |
cd docs
rm -rf build
sphinx-apidoc --separate --module-first -d 5 -f -o source/apidoc ../source/fab
make html
- name: move built docs to docs root
run: |
mv docs/build/html/* docs/
- name: git add built docs
run: |
git add docs/*
- name: commit
run: |
git commit -m "docs build"
- name: push to gh_pages branch
run: |
echo "pushing from $GITHUB_REF_NAME to gh_pages"
git push --force origin $GITHUB_REF_NAME:gh_pages

0 comments on commit ad488c1

Please sign in to comment.