-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add github actions quarto deploy workflow
- Loading branch information
1 parent
feab67b
commit 774ed4a
Showing
1 changed file
with
73 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# based on: | ||
# - https://github.com/quarto-dev/quarto-actions/blob/main/examples/quarto-book-gh-pages.yaml | ||
# - https://github.com/actions/starter-workflows/blob/main/pages/static.yml | ||
|
||
on: | ||
push: | ||
branches: main | ||
pull_request: | ||
branches: main | ||
# to be able to trigger a manual build | ||
workflow_dispatch: | ||
|
||
name: Build and deploy Quarto site | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install R package dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libmagick++-dev libudunits2-dev libgdal-dev gdal-bin libgeos-dev libproj-dev libsqlite3-dev libssl-dev | ||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
use-public-rspm: true | ||
|
||
- uses: r-lib/actions/setup-renv@v2 | ||
|
||
- name: Install Quarto | ||
uses: quarto-dev/quarto-actions/setup@v2 | ||
with: | ||
tinytex: true | ||
|
||
- name: Render Quarto Project | ||
uses: quarto-dev/quarto-actions/render@v2 | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
# hard-coding `_site` feels a little gross, but it works | ||
path: _site | ||
|
||
deploy: | ||
if: github.event_name != 'pull_request' | ||
needs: build | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup pages | ||
uses: actions/configure-pages@v5 | ||
|
||
- name: Deploy to GitHub pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |