Publish website with slides to GH Pages #2
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 with slides to GH Pages" | |
on: | |
push: | |
branches: ["main"] | |
workflow_run: | |
workflows: ["Tests"] | |
branches: ["main"] | |
types: ["completed"] | |
workflow_dispatch: | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow one concurrent deployment | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: "ubuntu-latest" | |
if: "${{ github.event.workflow_run.conclusion == 'success' }}" | |
permissions: | |
contents: "write" | |
steps: | |
- name: "Check out repository" | |
uses: "actions/checkout@v3" | |
- name: "Set up Quarto" | |
uses: "quarto-dev/quarto-actions/setup@v2" | |
- name: "Render" | |
uses: "quarto-dev/quarto-actions/render@v2" | |
- name: "Upload artifact" | |
uses: "actions/upload-pages-artifact@v1" | |
with: | |
path: "./_site" | |
# Deploy to GH Pages | |
deploy: | |
environment: | |
name: "github-pages" | |
url: "http://nsidc.github.io/" | |
runs-on: "ubuntu-latest" | |
needs: "build" | |
steps: | |
- name: "Deploy to GitHub Pages" | |
id: "deployment" | |
uses: "actions/deploy-pages@v1" |