From 8776aaf3ebefdda84c7654715823a205d047802a Mon Sep 17 00:00:00 2001 From: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com> Date: Wed, 11 Dec 2024 13:48:23 +0100 Subject: [PATCH 01/18] fix: avoid hanging terminal if older version is available (#119) --- setup/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/action.yml b/setup/action.yml index 5d34f97..3684ab6 100644 --- a/setup/action.yml +++ b/setup/action.yml @@ -100,7 +100,7 @@ runs: QUARTO_PRINT_STACK: true if: ${{ inputs.tinytex == 'true'}} run: | - quarto install tool tinytex --log-level warning + quarto install tool tinytex --no-prompt --log-level warning case $RUNNER_OS in "Linux") echo "$HOME/bin" >> $GITHUB_PATH From 8ed911470153e2404344a14626ade1bac1290b7d Mon Sep 17 00:00:00 2001 From: Dan Halligan <144698471+danhalligan-la@users.noreply.github.com> Date: Tue, 11 Feb 2025 15:38:18 +0000 Subject: [PATCH 02/18] Update action.yml (#121) --- setup/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/action.yml b/setup/action.yml index 3684ab6..0ddd3f2 100644 --- a/setup/action.yml +++ b/setup/action.yml @@ -72,7 +72,7 @@ runs: [ ${{ runner.os }} != "Windows" ] && installer=${{ steps.download-quarto.outputs.installer }} case $RUNNER_OS in "Linux") - sudo apt install ./$installer + sudo apt -y install ./$installer ;; "macOS") sudo installer -pkg ./$installer -target '/' From 6e5c7357955b88126c567c05c43987022e5cc1c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serge=20Crois=C3=A9?= Date: Wed, 19 Feb 2025 15:07:17 +0100 Subject: [PATCH 03/18] Fix grammar in examples README md (#123) --- examples/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/README.md b/examples/README.md index 8cc09f7..9bc4f7c 100644 --- a/examples/README.md +++ b/examples/README.md @@ -13,7 +13,7 @@ - [Earthdata Cloud Cookbook](https://nasa-openscapes.github.io/earthdata-cloud-cookbook/) ([source](https://github.com/NASA-Openscapes/earthdata-cloud-cookbook), [workflow file](https://github.com/NASA-Openscapes/earthdata-cloud-cookbook/blob/main/.github/workflows/quarto-publish.yml)) This book contains `.md` and `.ipynb` files, and is built with Quarto and Python in GHA, and deployed to Github Pages. -- [R Manuals Quarto website](https://rstudio.github.io/r-manuals/) ([source](https://github.com/rstudio/r-manuals), [workflow file](https://github.com/rstudio/r-manuals/blob/main/.github/workflows/build-website.yaml)) This projects uses a workflow to build several books with R and Quarto and organizes them in a website deployed to Github pages. +- [R Manuals Quarto website](https://rstudio.github.io/r-manuals/) ([source](https://github.com/rstudio/r-manuals), [workflow file](https://github.com/rstudio/r-manuals/blob/main/.github/workflows/build-website.yaml)) This project uses a workflow to build several books with R and Quarto and organizes them in a website deployed to Github pages. - [Pathology Atlas](https://www.patolojiatlasi.com/EN) ([source](https://github.com/patolojiatlasi/patolojiatlasi.github.io), [workflow file](https://github.com/patolojiatlasi/patolojiatlasi.github.io/blob/main/.github/workflows/Quarto-Render-Bilingual-Book-Push-Other-Repos-GitLab.yml)) This multilingual website is rendered in two versions and deployed using Github Actions. @@ -21,7 +21,7 @@ * My project uses git lfs storage; how should I adapt the action? - If your project uses git lfs storage, you must opt-in to git lfs during `checkout` step. + If your project uses git lfs storage, you must opt-in to git lfs during the `checkout` step. ```yaml - name: Check out repository @@ -30,4 +30,4 @@ lfs: true # needed when using lfs for image storage ``` - See the [checkout action documentation](https://github.com/actions/checkout) for details. \ No newline at end of file + See the [checkout action documentation](https://github.com/actions/checkout) for details. From 4aad30c8580850f3af94808ee5aeeea0daa9471f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Cs=C3=A1rdi?= Date: Wed, 19 Feb 2025 15:16:21 +0100 Subject: [PATCH 04/18] Fix setup on linux arm64 (#122) Co-authored-by: Christophe Dervieux --- .github/workflows/test.yaml | 48 +++++++++++++++++++++++++++++++++++++ setup/action.yml | 9 ++++++- 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..5d63ec7 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,48 @@ +name: test.yaml + +permissions: read-all + +on: + push: + branches: [main, master] + pull_request: + workflow_dispatch: + inputs: + version: + description: | + Quarto version, may be "release", "pre-release" or a version number. + required: true + default: 'release' + type: string + +jobs: + quarto-setup: + runs-on: ${{ matrix.config.os }} + name: ${{ matrix.config.os }} + + strategy: + fail-fast: false + matrix: + config: + - { os: macos-latest } + - { os: macos-13 } + - { os: windows-latest } + - { os: ubuntu-latest } + - { os: ubuntu-22.04-arm } + + steps: + - uses: actions/checkout@v4 + + - uses: ./setup + with: + version: ${{ inputs.version || 'release' }} + token: ${{ secrets.GITHUB_TOKEN }} + + - run: quarto --version + + - run: which quarto + if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }} + + - run: where.exe quarto + if: ${{ runner.os == 'Windows' }} + diff --git a/setup/action.yml b/setup/action.yml index 0ddd3f2..c50692f 100644 --- a/setup/action.yml +++ b/setup/action.yml @@ -21,7 +21,14 @@ runs: # Select correct bundle for OS type case $RUNNER_OS in "Linux") - echo "BUNDLE_EXT=linux-amd64.deb" >> $GITHUB_ENV + case $RUNNER_ARCH in + ARM64|ARM) + echo "BUNDLE_EXT=linux-arm64.deb" >> $GITHUB_ENV + ;; + *) + echo "BUNDLE_EXT=linux-amd64.deb" >> $GITHUB_ENV + ;; + esac ;; "macOS") echo "BUNDLE_EXT=macos.pkg" >> $GITHUB_ENV From 3ab775c4ccaa1e3cb4828c1c0ae4223ef6ed4151 Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Wed, 19 Feb 2025 15:35:53 +0100 Subject: [PATCH 05/18] correct way to call action in test --- .github/workflows/test.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5d63ec7..23966c5 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -14,6 +14,10 @@ on: required: true default: 'release' type: string + tinytex: + description: 'If true, install TinyTex, required for PDF rendering' + required: false + default: 'true' jobs: quarto-setup: @@ -34,9 +38,11 @@ jobs: - uses: actions/checkout@v4 - uses: ./setup + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: version: ${{ inputs.version || 'release' }} - token: ${{ secrets.GITHUB_TOKEN }} + tinytex: ${{ inputs.tinytex == 'true'}} - run: quarto --version From 9e48da27e184aa238fcb49f5db75469626d43adb Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Wed, 19 Feb 2025 11:12:41 -0600 Subject: [PATCH 06/18] GHA - test release and pre-release install (#124) --- .github/workflows/test.yaml | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 23966c5..479b500 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -17,22 +17,27 @@ on: tinytex: description: 'If true, install TinyTex, required for PDF rendering' required: false - default: 'true' + default: 'false' jobs: quarto-setup: runs-on: ${{ matrix.config.os }} - name: ${{ matrix.config.os }} + name: ${{ matrix.config.os }} (${{ inputs.version || matrix.version }}) strategy: fail-fast: false matrix: + version: ['release', 'pre-release'] config: - - { os: macos-latest } - - { os: macos-13 } - - { os: windows-latest } - - { os: ubuntu-latest } - - { os: ubuntu-22.04-arm } + # Default config for standard platforms + - os: macos-latest + - os: macos-13 + - os: windows-latest + tinytex: 'false' + - os: ubuntu-latest + # Special config for ARM + - os: ubuntu-22.04-arm + tinytex: 'false' steps: - uses: actions/checkout@v4 @@ -41,8 +46,8 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - version: ${{ inputs.version || 'release' }} - tinytex: ${{ inputs.tinytex == 'true'}} + version: ${{ inputs.version || matrix.version }} + tinytex: ${{ inputs.tinytex || matrix.config.tinytex || 'true' }} - run: quarto --version @@ -51,4 +56,4 @@ jobs: - run: where.exe quarto if: ${{ runner.os == 'Windows' }} - + From 0b1af936bc71f01c0dba704810b3010c95997d0e Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Fri, 7 Mar 2025 18:54:05 +0100 Subject: [PATCH 07/18] correctly handle matrix in test for workflow dispatch --- .github/workflows/test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 479b500..6eda103 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -27,7 +27,7 @@ jobs: strategy: fail-fast: false matrix: - version: ['release', 'pre-release'] + version: ${{ inputs.version && format('["{0}"]', inputs.version) || fromJSON('["release", "pre-release"]') }} config: # Default config for standard platforms - os: macos-latest @@ -46,7 +46,7 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - version: ${{ inputs.version || matrix.version }} + version: ${{ matrix.version }} tinytex: ${{ inputs.tinytex || matrix.config.tinytex || 'true' }} - run: quarto --version From 58e691f3c514e216e7823842fa41bd7b006ea60a Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Fri, 9 May 2025 13:25:45 +0200 Subject: [PATCH 08/18] Fix test workflow --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6eda103..7783fba 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -27,7 +27,7 @@ jobs: strategy: fail-fast: false matrix: - version: ${{ inputs.version && format('["{0}"]', inputs.version) || fromJSON('["release", "pre-release"]') }} + version: ${{ inputs.version && fromJSON(format('["{0}"]', inputs.version)) || fromJSON('["release", "pre-release"]') }} config: # Default config for standard platforms - os: macos-latest From e61e6c42f9039e0435e846874e420611adf19a7b Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Thu, 15 May 2025 13:21:30 +0200 Subject: [PATCH 09/18] fix example for QUARTO_PROFILE in publish doc closes #127 --- publish/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/publish/README.md b/publish/README.md index f1dbc1c..c7fc2f3 100644 --- a/publish/README.md +++ b/publish/README.md @@ -99,10 +99,10 @@ The `with` parameter can also be set to configure the following ```yaml - name: Render Quarto Project - uses: quarto-dev/quarto-actions/render@v2 + uses: quarto-dev/quarto-actions/publish@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # this secret is always available for github actions QUARTO_PROFILE: preview with: target: gh-pages -``` \ No newline at end of file +``` From 8c7a6fc579a2eb29959adcc440e0c61f1f96ff43 Mon Sep 17 00:00:00 2001 From: Daniel Kapitan Date: Sun, 14 Sep 2025 17:03:20 +0200 Subject: [PATCH 10/18] Add GitHub Actions workflow for Quarto publishing (#129) Example that uses uv for Python package management. --- examples/quarto-publish-example-with-uv.yml | 31 +++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 examples/quarto-publish-example-with-uv.yml diff --git a/examples/quarto-publish-example-with-uv.yml b/examples/quarto-publish-example-with-uv.yml new file mode 100644 index 0000000..58e45e2 --- /dev/null +++ b/examples/quarto-publish-example-with-uv.yml @@ -0,0 +1,31 @@ +on: + workflow_dispatch: + push: + branches: main + +name: Quarto Publish + +jobs: + build-deploy: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Check out repository + uses: actions/checkout@v4 + - name: Install uv + uses: astral-sh/setup-uv@v6 + with: + enable-cache: true + - name: Install the project + run: uv sync --locked --all-extras --dev + - name: Add venv to PATH + run: echo "$(pwd)/.venv/bin" >> $GITHUB_PATH + - name: Set up Quarto + uses: quarto-dev/quarto-actions/setup@v2 + - name: Render and Publish + uses: quarto-dev/quarto-actions/publish@v2 + with: + target: gh-pages + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 3e5a86f3ef0b520f38984b4e5c84f068f61f2a64 Mon Sep 17 00:00:00 2001 From: Hugo Gruson <10783929+Bisaloo@users.noreply.github.com> Date: Thu, 30 Oct 2025 14:53:27 +0100 Subject: [PATCH 11/18] Do not rely on gh cli utility (#132) --- setup/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/action.yml b/setup/action.yml index c50692f..c66e9dd 100644 --- a/setup/action.yml +++ b/setup/action.yml @@ -52,8 +52,8 @@ runs: # On Windows scoop will be used so no need to download the release if [ "${{inputs.version}}" == "release" ]; then # download the latest stable release - gh release download --repo github.com/quarto-dev/quarto-cli --pattern ${{ format('*{0}', env.BUNDLE_EXT) }} version=$(curl https://quarto.org/docs/download/_download.json | jq -r '.version') + wget https://github.com/quarto-dev/quarto-cli/releases/download/v$version/quarto-$version-${{env.BUNDLE_EXT}} echo "version=${version}" >> $GITHUB_OUTPUT elif [ "${{inputs.version}}" == "LATEST" -o "${{inputs.version}}" == "pre-release" ]; then # get latest pre release version From a82bdfacc5cc6cb22ad256aad2c4435f75ae8e43 Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Tue, 25 Nov 2025 15:22:59 +0100 Subject: [PATCH 12/18] initialize a CLAUDE.md --- .claude/CLAUDE.md | 93 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 .claude/CLAUDE.md diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md new file mode 100644 index 0000000..c2633ed --- /dev/null +++ b/.claude/CLAUDE.md @@ -0,0 +1,93 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +This repository provides three GitHub Actions for working with Quarto: + +1. **setup** - Installs Quarto on GitHub Actions runners +2. **render** - Renders a Quarto project +3. **publish** - Publishes a Quarto project to various services + +The actions are implemented as composite actions (using shell scripts) rather than JavaScript or Docker container actions. + +## Architecture + +### Action Structure + +Each action lives in its own directory with: +- `action.yml` - Action definition with inputs/outputs +- `README.md` - User-facing documentation +- Supporting scripts (e.g., `install-quarto-windows.ps1` for setup action) + +All actions use `using: 'composite'` with shell steps, making them OS-agnostic. + +### Platform-Specific Installation (setup action) + +The setup action handles three platforms differently: + +- **Linux**: Downloads `.deb` file (AMD64 or ARM64), installs with `apt` +- **macOS**: Downloads `.pkg` file, installs with `installer` +- **Windows**: Uses Scoop package manager via `install-quarto-windows.ps1` (workaround because MSI installation doesn't work in GitHub Actions) + +Version handling: +- `"release"` (default) - Fetches latest stable from `quarto.org/docs/download/_download.json` +- `"pre-release"` - Fetches latest dev from `quarto.org/docs/download/_prerelease.json` +- Specific version (e.g., `"1.3.450"`) - Downloads that exact release + +### Quarto Binary Detection + +The setup action determines the correct binary based on `$RUNNER_OS` and `$RUNNER_ARCH`, setting `BUNDLE_EXT` environment variable to one of: +- `linux-amd64.deb` +- `linux-arm64.deb` +- `macos.pkg` +- `win.msi` + +### Render and Publish Actions + +Both actions: +- Accept a `path` input for subdirectory rendering/publishing +- Set `QUARTO_PRINT_STACK: true` for better debugging +- Use bash shells exclusively (even on Windows, leveraging Git Bash) + +The publish action: +- Configures git identity for gh-pages commits +- Handles multiple publishing targets (gh-pages, Netlify, Quarto Pub, RStudio Connect) +- Supports `--no-render` flag to skip rendering before publishing +- Has both `to` and `target` inputs (aliases) for backward compatibility + +## Testing + +Run tests with: +```bash +gh workflow run test.yaml +``` + +The test workflow (`.github/workflows/test.yaml`): +- Tests on multiple OS/architecture combinations (macOS, Windows, Ubuntu AMD64, Ubuntu ARM) +- Matrix tests both `release` and `pre-release` versions by default +- Supports manual dispatch to test specific versions or enable TinyTeX +- Uses `uses: ./setup` to test the action directly from the working tree + +## Version Management + +This repository follows GitHub's recommended release management: +- Major versions (`v2`, `v1`) are moving tags that point to latest minor/patch +- Specific versions (`v2.0.1`) are immutable +- Users should use `quarto-dev/quarto-actions/setup@v2` for automatic updates +- Breaking changes only come with major version bumps + +## Windows-Specific Considerations + +Windows installation uses Scoop because MSI installation doesn't work reliably in GitHub Actions. The `install-quarto-windows.ps1` script: +- Installs Scoop if not present +- Adds the `r-bucket` (maintained by Chris at github.com/cderv/r-bucket.git) +- Installs Quarto or specific versions through Scoop +- Adds Scoop shims to `$GITHUB_PATH` + +## Common Issues + +- **TinyTeX PATH**: After installing TinyTeX, the action adds its binary directory to `$GITHUB_PATH` differently per platform (Linux: `$HOME/bin`, macOS: finds via `~/Library/TinyTeX`, Windows: finds via `$APPDATA/TinyTeX`) +- **Chromium crashes**: Past issues with Chromium when rendering PDFs (see commented-out Chrome installation steps in render action) +- **Output directory detection**: Render action attempts to detect `_book` or `_site` output directories From 0ffb259df7c391caef1e145215f4d2214e72bc5a Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Tue, 25 Nov 2025 17:57:52 +0100 Subject: [PATCH 13/18] Fix publish action for actions/checkout@v6 worktree credentials (#133) actions/checkout@v6 moved credentials from .git/config to a separate file using includeIf for security (actions/checkout#2286). This breaks quarto publish gh-pages which uses git worktrees, since the includeIf condition doesn't match worktree paths. The fix propagates the credential configuration to worktrees by adding a second includeIf rule that matches .git/worktrees/* paths. This is backward compatible - it only runs if v6-style credentials exist. Also updates test.yaml to use checkout@v6 and documents v6 compatibility in publish/README.md. --- .github/workflows/test.yaml | 2 +- publish/README.md | 4 +++- publish/action.yml | 7 +++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 7783fba..aca1c20 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -40,7 +40,7 @@ jobs: tinytex: 'false' steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: ./setup env: diff --git a/publish/README.md b/publish/README.md index c7fc2f3..2ebd831 100644 --- a/publish/README.md +++ b/publish/README.md @@ -28,9 +28,11 @@ Give this token a memorable name, and note the resulting string (or keep this wi ## GitHub Pages -> See also about Github Pages publishing support in Quarto. +> See also about Github Pages publishing support in Quarto. > And about using Github Actions to publish to Github Pages with Quarto. +**Note**: This action is compatible with `actions/checkout@v6` and later. If you experience credential errors when publishing to gh-pages (e.g., "fatal: could not read Username"), ensure you're using `actions/checkout@v6` or later, or pin to `actions/checkout@v5` until you can upgrade. See [#133](https://github.com/quarto-dev/quarto-actions/issues/133) for details. + 1. Quarto needs to configure the repository for publishing through GitHub Actions. To do this, run `quarto publish gh-pages` locally, once. This will create a new branch called `gh-pages` and push it to the remote repository, and configure the gh-pages branch to be the [publishing source for GitHub Pages](https://quarto.org/docs/publishing/github-pages.html#source-branch). 2. Then you need to configure your repo to use Github Actions to publish, by adding GitHub Actions workflow to your project. diff --git a/publish/action.yml b/publish/action.yml index 7d76532..8f05eac 100644 --- a/publish/action.yml +++ b/publish/action.yml @@ -50,6 +50,13 @@ runs: run: | git config --global user.email "${{ inputs.GITHUB_EMAIL }}" git config --global user.name "${{ inputs.GITHUB_USERNAME }}" + # Propagate git credentials to worktrees (required for actions/checkout@v6) + # See: https://github.com/quarto-dev/quarto-actions/issues/133 + if git config get includeIf.gitdir:"$(git rev-parse --path-format=absolute --git-dir)".path &>/dev/null; then + GIT_DIR=$(git rev-parse --path-format=absolute --git-dir) + CRED_PATH=$(git config get --path includeIf.gitdir:"${GIT_DIR}".path) + git config set --path includeIf.gitdir:"${GIT_DIR}/worktrees/*".path "${CRED_PATH}" + fi TARGET="${{ inputs.to }}" if [ "$TARGET" == "" ]; then TARGET="${{ inputs.target }}" From 23bb8b367947195a66a78bcf45cdcc392d2140b8 Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Tue, 25 Nov 2025 17:58:42 +0100 Subject: [PATCH 14/18] Add automated testing for publish action Creates a test workflow that generates a documentation website from the repository READMEs and publishes it to gh-pages. This tests the full publish action workflow including the worktree credential handling. The workflow: - Runs on push to main and manual dispatch - Dynamically generates Quarto site from READMEs via heredoc - Fixes relative links to work in the rendered site - Publishes to gh-pages, testing the complete worktree code path Also creates a minimal documentation site at quarto-dev.github.io/quarto-actions/ as a useful side benefit. --- .github/docs/_quarto.yml | 16 +++++ .github/workflows/test-publish.yaml | 102 ++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 .github/docs/_quarto.yml create mode 100644 .github/workflows/test-publish.yaml diff --git a/.github/docs/_quarto.yml b/.github/docs/_quarto.yml new file mode 100644 index 0000000..8833c5c --- /dev/null +++ b/.github/docs/_quarto.yml @@ -0,0 +1,16 @@ +project: + type: website + +website: + title: "Quarto Actions" + navbar: + left: + - text: "Setup" + href: setup.qmd + - text: "Render" + href: render.qmd + - text: "Publish" + href: publish.qmd + right: + - icon: github + href: https://github.com/quarto-dev/quarto-actions diff --git a/.github/workflows/test-publish.yaml b/.github/workflows/test-publish.yaml new file mode 100644 index 0000000..f091c03 --- /dev/null +++ b/.github/workflows/test-publish.yaml @@ -0,0 +1,102 @@ +name: Test Publish Action + +on: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: write + +jobs: + test-publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - uses: ./setup + with: + version: release + + # Generate website content from README files + - name: Generate Quarto site + run: | + # Create working directory structure + mkdir -p _site_source + + # Copy Quarto config + cp .github/docs/_quarto.yml _site_source/ + + # Define repo URL for link fixing + REPO_URL="https://github.com/quarto-dev/quarto-actions" + + # Function to fix links in a README + fix_readme_links() { + local file=$1 + # First: Fix known action page links to point to site pages + sed -i \ + -e 's|\](./setup)|\](setup.qmd)|g' \ + -e 's|\](./render)|\](render.qmd)|g' \ + -e 's|\](./publish)|\](publish.qmd)|g' \ + "$file" + # Second: All remaining ./ links point to GitHub + sed -i "s|\](./|\](${REPO_URL}/tree/main/|g" "$file" + } + + # Copy and fix main README + cp README.md _site_source/ + fix_readme_links _site_source/README.md + + # Copy and fix action READMEs + cp setup/README.md _site_source/setup-readme.md + fix_readme_links _site_source/setup-readme.md + + cp render/README.md _site_source/render-readme.md + fix_readme_links _site_source/render-readme.md + + cp publish/README.md _site_source/publish-readme.md + fix_readme_links _site_source/publish-readme.md + + # Generate index.qmd + cat > _site_source/index.qmd <<'EOF' + --- + title: "Quarto Actions" + --- + + This site demonstrates the quarto-actions and tests the publish action. + + {{< include README.md >}} + EOF + + # Generate action pages + cat > _site_source/setup.qmd <<'EOF' + --- + title: "Setup Action" + --- + + {{< include setup-readme.md >}} + EOF + + cat > _site_source/render.qmd <<'EOF' + --- + title: "Render Action" + --- + + {{< include render-readme.md >}} + EOF + + cat > _site_source/publish.qmd <<'EOF' + --- + title: "Publish Action" + --- + + {{< include publish-readme.md >}} + EOF + + # Test the publish action + - uses: ./publish + with: + target: gh-pages + path: _site_source + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 2e0743a7011dd49f0d97310f556974c5668f6f18 Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Tue, 25 Nov 2025 20:28:34 +0100 Subject: [PATCH 15/18] Add Examples page with dynamic sidebar navigation Uses yq to dynamically discover and add all example-*.md files to a floating sidebar. Automatically adapts to new examples without manual config updates. --- .github/docs/_quarto.yml | 2 ++ .github/workflows/test-publish.yaml | 34 +++++++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/.github/docs/_quarto.yml b/.github/docs/_quarto.yml index 8833c5c..1042c5c 100644 --- a/.github/docs/_quarto.yml +++ b/.github/docs/_quarto.yml @@ -11,6 +11,8 @@ website: href: render.qmd - text: "Publish" href: publish.qmd + - text: "Examples" + href: examples.qmd right: - icon: github href: https://github.com/quarto-dev/quarto-actions diff --git a/.github/workflows/test-publish.yaml b/.github/workflows/test-publish.yaml index f091c03..a3fff74 100644 --- a/.github/workflows/test-publish.yaml +++ b/.github/workflows/test-publish.yaml @@ -18,13 +18,18 @@ jobs: with: version: release + - name: Install yq + run: | + wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/local/bin/yq + chmod +x /usr/local/bin/yq + # Generate website content from README files - name: Generate Quarto site run: | # Create working directory structure - mkdir -p _site_source + mkdir -p _site_source/examples - # Copy Quarto config + # Copy base Quarto config cp .github/docs/_quarto.yml _site_source/ # Define repo URL for link fixing @@ -38,6 +43,7 @@ jobs: -e 's|\](./setup)|\](setup.qmd)|g' \ -e 's|\](./render)|\](render.qmd)|g' \ -e 's|\](./publish)|\](publish.qmd)|g' \ + -e 's|\](./examples)|\](examples.qmd)|g' \ "$file" # Second: All remaining ./ links point to GitHub sed -i "s|\](./|\](${REPO_URL}/tree/main/|g" "$file" @@ -57,6 +63,22 @@ jobs: cp publish/README.md _site_source/publish-readme.md fix_readme_links _site_source/publish-readme.md + cp examples/README.md _site_source/examples-readme.md + fix_readme_links _site_source/examples-readme.md + + # Add sidebar navigation with yq + yq eval -i '.website.sidebar = [{"title": "Examples", "style": "floating", "contents": ["examples.qmd", {"section": "Workflow Examples", "contents": []}]}]' _site_source/_quarto.yml + + # Copy example files and add to sidebar dynamically + for example in examples/example-*.md; do + filename=$(basename "$example" .md) + cp "$example" "_site_source/examples/${filename}.qmd" + fix_readme_links "_site_source/examples/${filename}.qmd" + + # Add to sidebar contents + yq eval -i '.website.sidebar[0].contents[1].contents += ["examples/'${filename}'.qmd"]' _site_source/_quarto.yml + done + # Generate index.qmd cat > _site_source/index.qmd <<'EOF' --- @@ -93,6 +115,14 @@ jobs: {{< include publish-readme.md >}} EOF + cat > _site_source/examples.qmd <<'EOF' + --- + title: "Examples" + --- + + {{< include examples-readme.md >}} + EOF + # Test the publish action - uses: ./publish with: From 9ab4dea92e86959ec7c6a335a20da3063d4f3ed4 Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Tue, 25 Nov 2025 20:33:41 +0100 Subject: [PATCH 16/18] Update macOS configuration in CI workflow to use macos-15-intel --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index aca1c20..5d393c7 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -31,7 +31,7 @@ jobs: config: # Default config for standard platforms - os: macos-latest - - os: macos-13 + - os: macos-15-intel - os: windows-latest tinytex: 'false' - os: ubuntu-latest From 8a96df13519ee81fd526f2dfca5962811136661b Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Tue, 25 Nov 2025 20:34:44 +0100 Subject: [PATCH 17/18] Add weekly schedule triggers for test workflows --- .github/workflows/test-publish.yaml | 2 ++ .github/workflows/test.yaml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/test-publish.yaml b/.github/workflows/test-publish.yaml index a3fff74..150edb5 100644 --- a/.github/workflows/test-publish.yaml +++ b/.github/workflows/test-publish.yaml @@ -3,6 +3,8 @@ name: Test Publish Action on: push: branches: [main] + schedule: + - cron: '0 0 * * 1' # Weekly on Monday at midnight UTC workflow_dispatch: permissions: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5d393c7..65932e0 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -6,6 +6,8 @@ on: push: branches: [main, master] pull_request: + schedule: + - cron: '0 0 * * 0' # Weekly on Sunday at midnight UTC workflow_dispatch: inputs: version: From 877ac2051a6af6ad478f464f251d2fca9c8b567d Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Tue, 25 Nov 2025 20:39:50 +0100 Subject: [PATCH 18/18] Add gitignore dev tooling --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..14fb559 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ + +# dev tooling +.private-journal/ \ No newline at end of file