feat: add trigger-coolify-deploy composite action - #4
Merged
Conversation
Lets callers deploy a Coolify app via API, poll it to a terminal status, and optionally health-check it before returning — used to enforce cross-app deploy ordering (api before web) from GitHub Actions instead of Coolify's native, unordered git-push auto-deploy, which can deadlock/race under a single concurrent build slot.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a new reusable composite GitHub Action for orchestrating Coolify deployments from GitHub Actions, enabling ordered multi-app deploys (e.g., API before web) by triggering a deploy via Coolify’s API, polling for completion, and optionally performing an HTTP health check.
Changes:
- Added a new composite action
.github/actions/trigger-coolify-deployto trigger and wait for Coolify deployments (with optional PR-preview retry + health check). - Documented the new action in
README.mdwith inputs and a usage example. - Added an
[Unreleased]changelog entry describing the new action and its motivation.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
.github/actions/trigger-coolify-deploy/action.yml |
Adds composite action that triggers Coolify deploys, polls terminal status, and optionally health-checks. |
README.md |
Documents the new composite action (inputs + example usage). |
CHANGELOG.md |
Records the new action under [Unreleased] → ### Added. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+209
to
+212
| health_url="${base_url%/}${HEALTH_CHECK_PATH}" | ||
| echo "Health-checking ${health_url} (timeout ${POLL_TIMEOUT_SECONDS}s)..." | ||
| start=$(date +%s) | ||
| while :; do |
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
.github/actions/trigger-coolify-deploycomposite action: trigger a Coolify application deploy via API, poll it to a terminal status (finished/failed/cancelled-by-user), and optionally HTTP health-check it before returning.pr_number) with retry-on-"not found" to tolerate the race against Coolify's own webhook-driven preview creation.Motivation
Part of a 3-repo change (
github-workflows→the-music-deck-admin→infrastructure) to replace Coolify's native, unordered git-push auto-deploy with GitHub-Actions-orchestrated deploy ordering fortmd-admin-api/tmd-admin-web. The VPS runs Coolify with a single concurrent build slot;tmd-admin-web's build makes a live fetch totmd-admin-apiduringnext build, so an unordered auto-deploy can deadlock or serve a stale/unhealthy sibling. This action is the shared building block bothdeploy-api-and-web.yml(api-then-web) jobs will call.Landing this first per the plan's merge order — no consumers yet.
Changes
.github/actions/trigger-coolify-deploy/action.yml: new composite action (mirrorssync-env-to-coolify's app-uuid resolution pattern).README.md: documents the new action (inputs table + usage example).CHANGELOG.md: entry under[Unreleased]→### Added.Test plan
action.ymlYAML parses; embedded bash passesbash -n.actionlintdoesn't apply toaction.ymlcomposite-action files in this repo (fails identically on the pre-existing, mergedsync-env-to-coolify/action.yml).the-music-deck-admin'sdeploy-api-and-web.yml(next PR in the sequence) calls it against real staging/PR-preview apps.Next steps
After merge, a maintainer runs
.github/scripts/release.sh minorto cutv4.2.0(current latest tag isv4.1.0), whichthe-music-deck-admin's workflow will pin to.