feat(coolify): add reusable Coolify deploy workflow - #42
Merged
Conversation
Adds coolify-deploy.yml, a thin reusable workflow that triggers a Coolify deploy via its API (GET /api/v1/deploy with a bearer token and resource UUID). Also exposes should_release/release_type/next_tag as outputs on release-train.yml so consumers can gate a chained deploy job on an actual release having happened, since a push with no integrated changes still completes the workflow_call successfully.
An unset UUID secret for a not-yet-configured environment resolves to an empty string, not an error — required: true on a workflow_call secret only enforces that the caller's secrets: block references the key, not that the value is non-empty. Without this, a branch whose Coolify environment doesn't exist yet (e.g. only prod is set up so far) would fail the deploy job on every push with a confusing 404/422 from calling the API with a blank uuid. Detect empty secrets up front and skip cleanly instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
coolify-deploy.yml, a thin reusable workflow that triggers a Coolify deploy via its API (GET /api/v1/deploywith a bearer token, resource UUID, and optionalforce), consistent with the "webhook token per repo" model described in the README.should_release/release_type/next_tagasworkflow_calloutputs onrelease-train.yml. A push with no integrated changes since the last tag still completes theuses:call successfully (the internalreleasejob is skipped, not failed), so a caller chaining a deploy job after this one needs an explicit signal that a release actually happened —needs.<job>.resultalone can't tell the difference.releasejob →deployjob gated onshould_release == 'true', environment selected bygithub.ref_name).Consumer usage
gardenia-apiandgardenia-webPRs wire this up as adeployjob in their ownrelease-train.yml, mappingdevelop/staging/maintoCOOLIFY_UUID_DEV/_STAGING/_PRODsecrets.Test plan
test.yml(shellcheck + release-train-detect tests) passes on this branchCOOLIFY_BASE_URL/COOLIFY_TOKEN/COOLIFY_UUID_*secrets configured, verify a push todeveloptriggers a real Coolify deploy and the job fails loudly on a bad token/UUIDGenerated by Claude Code