Skip to content

Commit ccdf275

Browse files
committed
fix(deploy): S3 bucket name variable
1 parent 14ea423 commit ccdf275

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/update-cloud-samples.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ jobs:
121121
AWS_CLOUDFRONT_DISTRIBUTION_ID: ${{ vars.AWS_CLOUDFRONT_DISTRIBUTION_ID }}
122122
AWS_S3_BUCKET_NAME: ${{ vars.AWS_S3_BUCKET_NAME }}
123123
S3_UPLOAD_PREFIX: console/one-click-sample-apps
124+
# FIXME: Remove the dry_run when we use a separate s3 bucket for 'Vespa Cloud CD' environment.
125+
# Ref: https://github.com/vespa-engine/sample-apps/settings/environments/5982781730/edit
126+
DRY_RUN: ${{ github.event_name != 'push' || github.ref_name != 'master' }}
124127

125128
steps:
126129
- name: Download All Packages
@@ -142,16 +145,16 @@ jobs:
142145
- name: Push Zip and JSON to S3
143146
env:
144147
# Add `--dryrun` if not on "push" event on default branch.
145-
AWS_S3_OPTIONS: --color=on --no-progress ${{ github.ref_name != 'master' && ' --dryrun' || '' }}
148+
AWS_S3_OPTIONS: --color=on --no-progress ${{ env.DRY_RUN && ' --dryrun' || '' }}
146149
run: |
147150
# Not an app, but artifact from the setup job.
148151
mv ./apps/console-json ./console-json
149152
150153
aws s3 sync ${{ env.AWS_S3_OPTIONS }} ./apps/ "s3://${AWS_S3_BUCKET_NAME}/${S3_UPLOAD_PREFIX}/"
151-
aws s3 cp ${{ env.AWS_S3_OPTIONS }} ./console-json/console-sample-apps.json "s3://${S3_BUCKET}/${S3_UPLOAD_PREFIX}/"
154+
aws s3 cp ${{ env.AWS_S3_OPTIONS }} ./console-json/console-sample-apps.json "s3://${AWS_S3_BUCKET_NAME}/${S3_UPLOAD_PREFIX}/"
152155
153156
- name: Invalidate Cloudfront Cache
154157
env:
155-
ECHO: ${{ github.ref_name != 'master' && ' echo' || '' }}
158+
ECHO: ${{ env.DRY_RUN && 'echo' || '' }}
156159
run: |
157160
$ECHO aws cloudfront create-invalidation --distribution-id "${AWS_CLOUDFRONT_DISTRIBUTION_ID}" --paths "${S3_UPLOAD_PREFIX}/*" --output text

0 commit comments

Comments
 (0)