Documentation updates #231
Workflow file for this run
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
# Build documentation | |
name: Build and upload documentation | |
defaults: | |
run: | |
shell: bash | |
on: # Runs on any push event in a PR or any push event to master | |
pull_request: | |
push: | |
branches: | |
- 'master' | |
jobs: | |
documentation: | |
name: ${{ matrix.os }} / ${{ matrix.python-version }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python-version: [3.11] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Update apt | |
run: sudo apt-get update | |
- name: Install LaTeX | |
run: sudo apt-get install -y texlive-latex-base texlive-latex-extra texlive-fonts-recommended # texlive-fonts-extra texlive-latex-recommended ghostscript | |
- name: Install optipng, dvipng and cm-super | |
run: sudo apt-get install -y optipng dvipng cm-super | |
- name: Get acc-models-lhc | |
run: git clone -b 2022 https://gitlab.cern.ch/acc-models/acc-models-lhc.git --depth 1 | |
- name: Move acc-models-lhc to examples folder | |
run: mv acc-models-lhc examples/ | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: pip | |
cache-dependency-path: '**/pyproject.toml' | |
- name: Install package with doc dependencies | |
run: python -m pip install ".[docs]" | |
- name: Build documentation | |
continue-on-error: true | |
run: make docs | |
# Upload artifacts if in PR so reviewers can have a quick look without building documentation from the branch locally | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v3 | |
if: success() && github.event_name == 'pull_request' # only for pushes in PR | |
with: | |
name: site-build | |
path: doc_build | |
retention-days: 7 | |
# Upload the doc to github pages branch and publish if from a push to master | |
- name: Upload documentation to gh-pages | |
if: success() && github.ref == 'refs/heads/master' # only for pushes to master | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: doc_build |