Skip to content

quarto-publish force-pushes gh-pages, and shares no concurrency group with preview-deploy #611

Description

@d-morrison

Observation

quarto-publish.yml's deploy step sets clean: true and clean-exclude: pr-preview/, but leaves force at JamesIves/github-pages-deploy-action's default, which is true. So every main-site publish force-pushes gh-pages.

clean-exclude preserves whatever pr-preview/ content existed as of the deploy job's own checkout of gh-pages, so the ordinary case is fine. The exposure is a preview deploy landing on gh-pages in the window between that checkout and the force push: a non-force push would be rejected and retried, while a force push discards it silently. The affected PR's preview link then 404s with nothing red anywhere to indicate why.

Nothing serializes the two halves against each other. quarto-publish.yml uses concurrency: gh-pages; preview-deploy.yml uses preview-deploy-<head_repository.id>-<head_branch>. Two different groups, so they can run concurrently by construction.

Why it may not be worth changing

The window is narrow and the consequence is a stale preview rather than a lost main site, which self-heals on the PR's next push. Setting force: false trades that for a deploy that can fail on a genuinely concurrent write, which is arguably worse for the main site.

The cheaper fix, if this is worth fixing at all, is probably to put both workflows in the same concurrency group — gh-pages — with cancel-in-progress: false, so they queue rather than race. That leaves the force push in place and removes the window entirely.

Where this came from

Noticed while migrating d-morrison/macros off a hand-rolled publish.yml that passed force: false explicitly (macros#83). The migration adopts gha's behaviour as-is; this issue records the difference rather than blocking on it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions