@@ -113,6 +113,7 @@ jobs:
113113 env :
114114 COOLIFY_TOKEN : ${{ secrets.COOLIFY_API_TOKEN }}
115115 PR_NUMBER : ${{ github.event.pull_request.number }}
116+ DOCKER_RESULT : ${{ needs.Docker.result }}
116117 run : |
117118 set -euo pipefail
118119
@@ -121,6 +122,13 @@ jobs:
121122 exit 0
122123 fi
123124
125+ # No image workflow, no SOURCE_COMMIT tag. Requesting the deployment anyway would only
126+ # queue one that fails on `manifest unknown`, under a green check.
127+ if [ "${DOCKER_RESULT}" != 'success' ]; then
128+ echo "::notice::No application-server image was published for this commit (Docker: ${DOCKER_RESULT}); skipping preview update."
129+ exit 0
130+ fi
131+
124132 body=$(mktemp)
125133 status=$(curl -sS -o "${body}" -w '%{http_code}' -X POST \
126134 -H "Authorization: Bearer ${COOLIFY_TOKEN}" \
@@ -187,11 +195,18 @@ jobs:
187195 Docker :
188196 uses : ./.github/workflows/ci-docker-build.yml
189197 needs : [detect-changes]
198+ # Coolify gives every same-repository pull request a preview and pins it to SOURCE_COMMIT, so
199+ # every such pull request needs an application-server tag at its head commit — including one that
200+ # touches only the preview stack or documentation. Without it the preview deployment fails with
201+ # `manifest unknown` for an image that will never be published. application-server-build is a
202+ # cached rebuild when server code did not change; the webapp and agent images stay gated by their
203+ # own inputs, so this costs one cached build, not the whole matrix.
190204 if : |
191205 needs.detect-changes.outputs.should_skip != 'true' && (
192206 needs.detect-changes.outputs.any-code == 'true' ||
193207 needs.detect-changes.outputs.ci-config == 'true' ||
194- github.event_name != 'pull_request'
208+ github.event_name != 'pull_request' ||
209+ github.event.pull_request.head.repo.full_name == github.repository
195210 )
196211 secrets : inherit
197212 with :
0 commit comments