Bump pypa/gh-action-pypi-publish from 1.9.0 to 1.10.0 (#245) #206
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
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@v2 | |
- name: Install R | |
uses: r-lib/actions/[email protected] | |
- name: Install R dependencies | |
uses: r-lib/actions/[email protected] | |
with: | |
packages: | | |
any::roxygen2 | |
github::Genentech/rd2markdown | |
- name: Install packages | |
run: | | |
cd python/ | |
pip install . | |
cd ../julia | |
julia --project=./docs -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' | |
cd ../R/ | |
Rscript -e "install.packages(getwd(), repos=NULL, type=\"source\")" | |
- 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 | |