Deploy #188
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 and deploy the documentation | |
# | |
name: Deploy | |
# Run on main branch only | |
on: | |
# uncomment 'pull_request' line to test the workflow in PR | |
# pull_request: | |
push: | |
branches: | |
- main | |
schedule: | |
# Run weekly at 00:00 on Sunday | |
- cron: '0 0 * * 0' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Micromamba | |
uses: mamba-org/[email protected] | |
with: | |
environment-file: environment.yml | |
cache-downloads: false | |
cache-environment: true | |
- name: Disable notebook cache for scheduled jobs | |
if: github.event_name == 'schedule' | |
run: | | |
sed -i"" 's/execute_notebooks: auto/execute_notebooks: force/' source/_config.yml | |
- name: Build documentation | |
run: make dirhtml | |
- name: Deploy documentation | |
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./_build/dirhtml | |
# Only keep the latest commit to avoid bloating the repository | |
force_orphan: true | |
user_name: 'github-actions[bot]' | |
user_email: 'github-actions[bot]@users.noreply.github.com' |