@@ -21,7 +21,7 @@ concurrency:
2121
2222env :
2323 PREFIX : ${{ vars.REVIEW_APP_PREFIX }}
24- APP_NAME : ${{ vars.REVIEW_APP_PREFIX }}-pr- ${{ github.event.pull_request.number || github.event.issue.number || github.event.inputs.pr_number }}
24+ APP_NAME : ${{ vars.REVIEW_APP_PREFIX }}-${{ github.event.pull_request.number || github.event.issue.number || github.event.inputs.pr_number }}
2525 CPLN_TOKEN : ${{ secrets.CPLN_TOKEN_STAGING }}
2626 CPLN_ORG : ${{ vars.CPLN_ORG_STAGING }}
2727 PR_NUMBER : ${{ github.event.pull_request.number || github.event.issue.number || github.event.inputs.pr_number }}
@@ -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 : |
0 commit comments