Skip to content

Include built Quarto site in releases for Zenodo archiving #33

@maehr

Description

@maehr

Feature request: Attach compressed Quarto build to manually created releases for Zenodo archiving

Currently, the GitHub Actions workflow (.github/workflows/quarto‑publish.yml) builds and optimizes the Quarto site in the _site directory, uploading it as an artifact for dead-link checking and Pages deployment. However, the built site is not included in the release archive, so Zenodo only receives the project source code when archiving a release.

Rationale

  • Zenodo uses release assets: Zenodo archives all assets attached to a GitHub Release, but by default, only the code tarball/zip are included. The built site must be attached manually.
  • Manual release creation: Releases are created manually in this project, so automation should only add assets to an already-published release – not trigger or create a release automatically.
  • No committing build artefacts: Committing built files (e.g., docs/ or _site/) to the repository is discouraged, as this clutters history and increases repo size unnecessarily.

Proposed Solution

  • Compress the Quarto site
    • After building and optimizing the site in _site, compress it into a single archive (e.g., tar -czf site.tar.gz -C _site . or use zip).
  • Upload to the manual release
    • Add a workflow triggered by release: published.
    • Use the official gh CLI (gh release upload ...) to upload site.tar.gz to the just-published release. This is preferable to deprecated actions/upload-release-asset and avoids auto-creating releases.

Example (to adapt for your workflow):

on:
  release:
    types: [published]

jobs:
  attach-site:
    runs-on: ubuntu-latest
    steps:
      - name: Check out repository
        uses: actions/checkout@v5

      # Build and optimize site as in 'build-optimize'
      ...
      - name: Compress built site
        run: tar -czf site.tar.gz -C _site .
      - name: Upload site to release
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          gh release upload ${{ github.event.release.tag_name }} site.tar.gz --clobber

Benefits:

  • Ensures the Quarto site (as deployed) is archived with the release and DOI.
  • Keeps repo history clean (no committed build artefacts).
  • Aligns with manual release workflow.

Conclusion:

  • It is necessary and efficient to compress (zip/tar) the built Quarto site before attaching it as a release asset, since GitHub releases only accept files. This approach supports manual release creation, clean history, and ensures that Zenodo archives the published documentation.

Type of change

Enhancement

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions