Setup a Quarto release (https://github.com/quarto-dev/quarto-cli/releases) using GitHub Actions. This action can be used to install Quarto on all runner OSs, so that quarto
will be available from the path.
This action will:
- On macOS and Linux:
- Download a release of Quarto from GitHub and install it
- use
gh
to download the latest available bundle, if noversion
is specified as input. Ifgh
is not available on your Github Action runner, you can specify a fixedversion
which will be directly downloaded usingwget
. - Install TinyTeX if requested.
- On Windows:
- Use Scoop (https://github.com/ScoopInstaller/Scoop) to install Quarto, as we have still an issue with Quarto MSI on Github Action (quarto-dev/quarto-cli#108). The action will also install Scoop on the runner.
We recommend using a Linux or MacOS runner if possible, especially if TinyTeX is needed.
-
version
- optional. If provided, the specific quarto version will be installed. Ex:version: 1.4.515
steps: - uses: quarto-dev/quarto-actions/setup@v2 with: version: 1.4.515
If not provided,
setup
will use the latest released version of quarto.If the latest
pre-release
build is desired, useversion: pre-release
. -
tinytex
- optional. Settinytex: true
to install TinyTeX usingquarto install tool tinytex
. Note: Installing TinyTeX on Windows can take several minutes.steps: - uses: quarto-dev/quarto-actions/setup@v2 env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tinytex: true
Setting
GH_TOKEN
is recommended as installing TinyTeX will query the github API. Otherwise, some API rate limit issue could happen which will make the step fails (e.g. with an explicit 403 - Forbidden error). A re-run of failed job on Github would solve it too.
For GitHub Enterprise Server (GHES), you may need to generate a personal access token (PAT) on github.com to enable downloading Quarto. GitHub's setup-python action uses a similar workaround, from which these instructions are adapted:
-
Create a PAT on any github.com account by using this link after logging into github.com (not your GHES instance). This PAT does not need any rights, so make sure all the boxes are unchecked.
-
Store this PAT in the repository / organization where you run your workflow, e.g. as
GH_GITHUB_COM_TOKEN
. You can do this by navigating to your repository -> Settings -> Secrets -> Actions -> New repository secret. -
In your workflow, incorporate your PAT as an environment variable. For example:
- name: Set up Quarto uses: quarto-dev/quarto-actions/setup@v2 env: GH_TOKEN: ${{ secrets.GH_GITHUB_COM_TOKEN }}
name: quarto-setup
on:
branch: main
jobs:
quarto-linux:
runs-on: ubuntu-latest
steps:
- uses: quarto-dev/quarto-actions/setup@v2
- run: |
quarto --version
quarto-windows:
runs-on: windows-latest
steps:
- uses: quarto-dev/quarto-actions/setup@v2
- run: |
quarto --version
quarto-macos:
runs-on: macos-latest
steps:
- uses: quarto-dev/quarto-actions/setup@v2
- run: |
quarto --version