Split build and deploy step #91
Workflow file for this run
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: publish website | |
on: | |
workflow_dispatch: | |
push: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Initialisation | |
uses: actions/checkout@v4 | |
- name: Setup conda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
environment-file: environment.yml | |
auto-activate-base: false | |
miniforge-version: latest | |
- name: Prepare sources | |
run: make prepare | |
- name: Build website | |
run: make html | |
- name: Linkcheck | |
run: make linkcheck | |
- name: Upload website artifacts | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: build/html/ | |
deploy: | |
if: ${{ github.ref == 'refs/heads/master' }} | |
needs: build | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{steps.deployment.outputs.page_url}} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |