publish pipeline only on tagging #5
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 pipeline | |
# - builds developer documentation | |
# - pushes documentation to gh-pages branch of the same repository | |
# | |
# Deployment is handled by pages-build-deployment bot | |
name: Build Documentation and Push to gh-pages Branch | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
push: | |
branches: [ main ] | |
# 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: | |
# This workflow contains a single job called "build" | |
build_documentation: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
with: | |
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
- name: Install Pandoc, repo and dependencies | |
run: | | |
sudo apt install pandoc | |
pip install . '.[docs]' | |
- name: Build and Commit | |
uses: sphinx-notes/pages@master | |
with: | |
install_requirements: true | |
documentation_path: docs/src | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
continue-on-error: true | |
with: | |
github_token: ${{ secrets.CORE_TOKEN }} | |
branch: gh-pages |