Skip to content

Run workflow on merge - #443

Open
remcoder wants to merge 3 commits into
developfrom
feature/cleanup-deploys-after-merge
Open

remcoder wants to merge 3 commits into
developfrom
feature/cleanup-deploys-after-merge

Conversation

@remcoder

@remcoder remcoder commented Sep 2, 2026

Copy link
Copy Markdown
Member

No description provided.


on:
pull_request:
types: [opened, synchronize, reopened, closed]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
types: [opened, synchronize, reopened, closed]
types: [opened, synchronize, reopened]

Could skip the whole workflow when closing. Teardown is not supported by the official action, but found this where people shared their solution: FirebaseExtended/action-hosting-deploy#60

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the expiration is for a preview specifically (not global), an alternative would be to have 30 days for all, and close sets it to 1 day so it cleans itself faster.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, opus was hallucinating then.. :-P

Comment on lines +27 to +28
- if: github.event.action != 'closed'
run: npm ci && npm run predeploy && npm run typedoc

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Asked copilot how to only run when changes target actual code. Did not try it, but sounds legit

Suggested change
- if: github.event.action != 'closed'
run: npm ci && npm run predeploy && npm run typedoc
- id: filter
uses: dorny/paths-filter@v3
with:
filters: |
target:
- 'src/**'
- '!src/__tests__/**'
- 'demo/**'
- if: github.event.action != 'closed'
run: npm ci && npm run predeploy && npm run typedoc

@sophiedeziel sophiedeziel added the meta a non-functional change, doesn't require a new release label Sep 10, 2026
The deploy action has no teardown, so running it on 'closed' did nothing.
A separate cleanup_preview job now deletes the PR's channel with the
firebase CLI, and a paths filter skips the build+deploy entirely for PRs
that cannot change the deployed output.
@github-actions

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit e51ceb9):

https://gcode-preview--pr443-feature-cleanup-depl-g55yzwhm.web.app

(expires Sat, 10 Oct 2026 21:06:55 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 59bd114ae4847b32c2bba0b68620b9069a3e3531

This branch has not been deployed

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

Labels

meta a non-functional change, doesn't require a new release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants