Skip to content

Deploy works on branches, We would like it to work only on release tag #58

Closed

Description

@ZohebShaikh

# Internal PR / default-branch push (inline), or any workflow_dispatch → deploy.
deploy:
if: >-
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'push' && github.ref_type != 'tag') ||
(github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository)
runs-on: ubuntu-latest

I don't understand the code enough to tell what should be the correct approach should be.

But it feels like the solutions is

github.event_name == 'push' && github.ref_type == 'tag

Activity

  1. coretl commented on Aug 21, 2026

    @coretl
    Contributor

    It does work on tags, but there is a different mechanism to work around actions/deploy-pages#383. This is using the workaround in that issue:

    # A tag can't deploy inline (same SHA as the default-branch push → Pages drops it
    # unless the event is workflow_dispatch). Wait for the release, then re-dispatch the
    # shim so the deploy runs on a workflow_dispatch event and re-serves.
    re-dispatch:
    if: github.event_name == 'push' && github.ref_type == 'tag'

    Fires on tag, and runs a workflow_dispatch of the job, which works around that bug

  2. coretl commented on Aug 21, 2026

    @coretl
    Contributor

    I'm considering whether it's worth doing the deploy here at all. My previous attempt was always doing a workflow dispatch, either triggered manually or when ci had finished. That would mean that push to GH pages would no longer be in CI for a PR, but would kick off transparently whenever a PR/tag/main was pushed to. It would still take 5 minutes, but no longer block CI for the PR (just like the old gh-pages branch used to do).

    What do you reckon?

  3. coretl commented on Aug 25, 2026

    @coretl
    Contributor

    Ok, this is done in v0.27.0

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