Skip to content

Commit 66d6e57

Browse files
committed
ci: only notify downstream if app image is pushed
1 parent 4787a86 commit 66d6e57

File tree

1 file changed

+58
-6
lines changed

1 file changed

+58
-6
lines changed

.github/workflows/release.yml

Lines changed: 58 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,67 @@ jobs:
9090
- name: Load Environment Variables from .env
9191
uses: xom9ikk/dotenv@v2
9292
- name: Publish Images
93+
id: publish
9394
if:
9495
needs.check_changesets.outputs.changeset_outputs_hasChangesets ==
9596
'false'
96-
run: make ${{ matrix.release }}
97-
notify_helm_charts:
98-
name: Notify Helm-Charts Downstream
97+
run: |
98+
OUTPUT=$(make ${{ matrix.release }} 2>&1)
99+
echo "$OUTPUT"
100+
101+
# Store the output in a file for the specific release target
102+
echo "$OUTPUT" > /tmp/${{ matrix.release }}-output.txt
103+
104+
# Upload the output as an artifact if this is release-app
105+
if [ "${{ matrix.release }}" = "release-app" ]; then
106+
if echo "$OUTPUT" | grep -q "already exists. Skipping push."; then
107+
echo "RELEASE_APP_PUSHED=false" > /tmp/release-app-status.txt
108+
else
109+
echo "RELEASE_APP_PUSHED=true" > /tmp/release-app-status.txt
110+
fi
111+
fi
112+
- name: Upload release-app status
113+
if: matrix.release == 'release-app'
114+
uses: actions/upload-artifact@v4
115+
with:
116+
name: release-app-status
117+
path: /tmp/release-app-status.txt
118+
check_release_app_pushed:
119+
name: Check if release-app pushed
99120
needs: [check_changesets, release]
100121
runs-on: ubuntu-24.04
122+
outputs:
123+
app_was_pushed: ${{ steps.check.outputs.pushed }}
101124
if:
102125
needs.check_changesets.outputs.changeset_outputs_hasChangesets == 'false'
126+
steps:
127+
- name: Download release-app status
128+
uses: actions/download-artifact@v4
129+
with:
130+
name: release-app-status
131+
path: /tmp
132+
- name: Check if release-app was pushed
133+
id: check
134+
run: |
135+
if [ -f /tmp/release-app-status.txt ]; then
136+
STATUS=$(cat /tmp/release-app-status.txt)
137+
echo "Release app status: $STATUS"
138+
if [ "$STATUS" = "RELEASE_APP_PUSHED=true" ]; then
139+
echo "pushed=true" >> $GITHUB_OUTPUT
140+
else
141+
echo "pushed=false" >> $GITHUB_OUTPUT
142+
fi
143+
else
144+
echo "No release-app status file found, assuming not pushed"
145+
echo "pushed=false" >> $GITHUB_OUTPUT
146+
fi
147+
notify_helm_charts:
148+
name: Notify Helm-Charts Downstream
149+
needs: [check_changesets, release, check_release_app_pushed]
150+
runs-on: ubuntu-24.04
151+
if: |
152+
needs.check_changesets.outputs.changeset_outputs_hasChangesets == 'false' &&
153+
needs.check_release_app_pushed.outputs.app_was_pushed == 'true'
103154
steps:
104155
- name: Checkout
105156
uses: actions/checkout@v4
@@ -125,10 +176,11 @@ jobs:
125176
});
126177
notify_ch:
127178
name: Notify CH Downstream
128-
needs: [check_changesets, release]
179+
needs: [check_changesets, release, check_release_app_pushed]
129180
runs-on: ubuntu-24.04
130-
if:
131-
needs.check_changesets.outputs.changeset_outputs_hasChangesets == 'false'
181+
if: |
182+
needs.check_changesets.outputs.changeset_outputs_hasChangesets == 'false' &&
183+
needs.check_release_app_pushed.outputs.app_was_pushed == 'true'
132184
steps:
133185
- name: Checkout
134186
uses: actions/checkout@v4

0 commit comments

Comments
 (0)