Skip to content

Commit 3d45555

Browse files
committed
fixes
1 parent 3b8ab76 commit 3d45555

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

.github/actions/delete-control-plane-app/delete-app.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@
77

88
set -e
99

10-
printenv
11-
1210
# Validate required environment variables
13-
: "${$APP_NAME:?APP_NAME environment variable is required}"
14-
: "${$CPLN_ORG:?CPLN_ORG environment variable is required}"
11+
: "${APP_NAME:?APP_NAME environment variable is required}"
12+
: "${CPLN_ORG:?CPLN_ORG environment variable is required}"
1513

1614
# Safety check: prevent deletion of production or staging apps
1715
if echo "$APP_NAME" | grep -iqE '(production|staging)'; then

.github/workflows/deploy-to-control-plane-review-app.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,17 +181,19 @@ jobs:
181181
echo "Skipping deployment for non-PR comment"
182182
fi
183183
fi
184+
if [[ "${{ env.DO_DEPLOY }}" == "false" ]]; then
185+
exit 0
186+
fi
184187
185188
- name: Setup Control Plane App if Not Existing
186-
if: env.DO_DEPLOY == 'true' && env.APP_EXISTS == 'false'
189+
if: env.APP_EXISTS == 'false'
187190
env:
188191
CPLN_TOKEN: ${{ secrets.CPLN_TOKEN_STAGING }}
189192
run: |
190193
echo "🔧 Setting up new Control Plane app..."
191194
cpflow setup-app -a ${{ env.APP_NAME }} --org ${{ vars.CPLN_ORG_STAGING }}
192195
193196
- name: Create Initial Comment
194-
if: env.DO_DEPLOY != 'false'
195197
uses: actions/github-script@v7
196198
id: create-comment
197199
with:
@@ -200,13 +202,12 @@ jobs:
200202
owner: context.repo.owner,
201203
repo: context.repo.repo,
202204
issue_number: process.env.PR_NUMBER,
203-
body: '🚀 Starting deployment process...\n\n' + process.env.CONSOLE_LINK
205+
body: '🚀 Starting deployment process...\n\n'
204206
});
205207
core.setOutput('comment-id', result.data.id);
206208
207209
- name: Set Deployment URLs
208210
id: set-urls
209-
if: env.DO_DEPLOY != 'false'
210211
uses: actions/github-script@v7
211212
with:
212213
script: |
@@ -237,7 +238,6 @@ jobs:
237238
);
238239
239240
- name: Initialize GitHub Deployment
240-
if: env.DO_DEPLOY != 'false'
241241
uses: actions/github-script@v7
242242
id: init-deployment
243243
with:
@@ -316,15 +316,13 @@ jobs:
316316
});
317317
318318
- name: Deploy to Control Plane
319-
if: env.DO_DEPLOY != 'false'
320319
run: cpflow deploy-image -a ${{ env.APP_NAME }} --run-release-phase --org ${{ vars.CPLN_ORG_STAGING }} --verbose
321320

322321
- name: Retrieve App URL
323322
id: workload
324323
run: echo "WORKLOAD_URL=$(cpln workload get rails --gvc ${{ env.APP_NAME }} | tee | grep -oP 'https://[^[:space:]]*\.cpln\.app(?=\s|$)' | head -n1)" >> "$GITHUB_OUTPUT"
325324

326325
- name: Update Status - Deployment Complete
327-
if: env.DO_DEPLOY != 'false'
328326
uses: actions/github-script@v7
329327
with:
330328
script: |

.github/workflows/nightly-remove-stale-review-apps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@ jobs:
5050
APP_NAME="qa-react-webpack-rails-tutorial-pr-$pr"
5151
CPLN_ORG=${{ vars.CPLN_ORG_STAGING }}
5252
echo "🗑️ Deleting stale review app for PR #$pr: $APP_NAME"
53-
${{ github.workspace }}/.github/actions/delete-control-plane-app/delete-app.sh
53+
APP_NAME=$APP_NAME CPLN_ORG=$CPLN_ORG ${{ github.workspace }}/.github/actions/delete-control-plane-app/delete-app.sh
5454
done

0 commit comments

Comments
 (0)