-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add cache invalidation to prerelease.yml
- Loading branch information
Showing
1 changed file
with
13 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Build & Publish Raygun4JS to the pre-release environment | ||
name: Publish Raygun4JS to the pre-release environment | ||
|
||
on: | ||
workflow_dispatch: | ||
|
@@ -40,6 +40,13 @@ jobs: | |
id: publish_s3 | ||
run: aws s3 sync ./dist ${{ secrets.AWS_PUBLISH_TARGET }} | ||
|
||
- name: Create CloudFront Cache Invalidation | ||
id: cache_invalidation | ||
run: | | ||
aws cloudfront create-invalidation \ | ||
--distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} \ | ||
--paths "${{ secrets.AWS_CLOUDFRONT_INVALIDATION_PATH }}" | ||
- name: Notify Slack | ||
id: slack | ||
uses: slackapi/[email protected] | ||
|
@@ -54,13 +61,6 @@ jobs: | |
"text": "A new pre-release version of Raygun4JS has been published" | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "plain_text", | ||
"text": "The Cloudfront cache will need to be invalidated for changes to take effect immediately." | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"text": { | ||
|
@@ -85,7 +85,11 @@ jobs: | |
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*S3 sync status:*\n_${{ steps.publish_s3.outcome }}_" | ||
"text": "*S3 publish status:*\n_${{ steps.publish_s3.outcome }}_" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*CloudFront cache invalidation status:*\n_${{ steps.cache_invalidation.outcome }}_" | ||
} | ||
] | ||
} | ||
|