Skip to content

Merge pull request #200 from roualdes/docs/update-logos #164

Merge pull request #200 from roualdes/docs/update-logos

Merge pull request #200 from roualdes/docs/update-logos #164

Workflow file for this run

name: Build BridgeStan docs
on:
push:
branches:
- 'main'
workflow_dispatch:
inputs:
version:
description: 'Version of BridgeStan docs to build'
required: false
type: string
default: ''
workflow_call:
inputs:
version:
description: 'Version of BridgeStan docs to build'
required: true
type: string
release:
types: [published]
jobs:
build-docs:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Check out github
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install dependencies (python)
run: |
python -m pip install --upgrade pip wheel
python -m pip install --upgrade -r docs/requirements.txt
- name: Install os dependencies
run: |
sudo apt-get update -y
sudo apt-get install pandoc doxygen -y
- name: Set up Julia
uses: julia-actions/setup-julia@v1
- name: Install package
run: |
cd python/
pip install .
cd ../julia
julia --project=./docs -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Calculate version
if:
run: |
if [[ "${{ inputs.version }}" != "" ]]; then
echo "BS_DOCS_VERSION=${{ inputs.version }}" >> $GITHUB_ENV
else
echo "BS_DOCS_VERSION=latest" >> $GITHUB_ENV
fi
- name: Build docs
run: |
cd docs/
export BS_DOCS_VERSION=$BS_DOCS_VERSION
make html
- name: Check out github
uses: actions/checkout@v4
with:
path: docs/_build/bs-docs
ref: gh-pages
- name: Commit html docs
run: |
cd docs/_build/
ls
rm -rf bs-docs/$BS_DOCS_VERSION
cp -r html bs-docs/$BS_DOCS_VERSION
cd bs-docs/
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit --amend -m "Rebuild docs"
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: docs/_build/bs-docs
force: true