Merge pull request #90 from muon-spectroscopy-computational-project/7… #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
# This is a basic workflow to help you get started with Actions | |
name: Build and deploy docs | |
# Controls when the action will run. | |
on: | |
# Triggers the workflow on push or pull request events but only for changes to docs | |
push: | |
paths: | |
- "docs/**" | |
- .github/workflows/docs.yml | |
pull_request: | |
paths: | |
- "docs/**" | |
- .github/workflows/docs.yml | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
build-deploy: | |
name: Build and deploy docs | |
runs-on: ubuntu-latest | |
env: | |
gh_token: ${{ secrets.GITHUB_TOKEN }} # Created by GitHub at start of workflow | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
# Installs dependencies | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install wheel | |
if [ -f requirements-docs.txt ]; then pip install -r requirements-docs.txt; else pip install .[docs]; fi | |
# Build the docs | |
- name: Build docs | |
run: mkdocs build | |
working-directory: docs | |
# Deploy docs only if this is an update to main | |
- name: Deploy docs | |
if: ${{ success() && github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
run: mkdocs gh-deploy | |
working-directory: docs | |
env: | |
GITHUB_TOKEN: ${{ env.gh_token }} |