Publish Quarto Site
Publish Quarto Site renders and publishes a Quarto website to the gh-pages branch of your repository. It automatically creates the branch if it does not already exist.
Quick Start
Copy the following to .github/workflows/publish-quarto-site.yml:
name: Publish Quarto Site
on:
push:
branches: [main]
permissions:
contents: write
pages: write
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: MiguelRodo/actions/publish-quarto-site@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}Inputs
| Input | Description | Required | Default |
|---|---|---|---|
github_token |
Token used to push to the gh-pages branch. Use ${{ secrets.GITHUB_TOKEN }}. |
Yes | — |
How It Works
- Configures git with the
github-actions[bot]identity. - Checks whether
gh-pagesexists on the remote. If not, creates an empty orphan branch and pushes it. - Installs Quarto via
quarto-dev/quarto-actions/setup@v2. - Publishes the rendered site to
gh-pagesviaquarto-dev/quarto-actions/publish@v2.
Troubleshooting
- Permission denied pushing to
gh-pages: Ensure the calling workflow setspermissions: contents: write(andpages: writeif using GitHub Pages deployments). - Quarto render errors: Rendering is delegated to
quarto-dev/quarto-actions/publish. See the quarto-actions documentation for render-related issues.