Skip to content

Commit

Permalink
add cache invalidation to prerelease.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
redJ4y committed Aug 20, 2024
1 parent 58c4a6e commit a5fadcd
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/prerelease.yml
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:
Expand Down Expand Up @@ -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]
Expand All @@ -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": {
Expand All @@ -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 }}_"
}
]
}
Expand Down

0 comments on commit a5fadcd

Please sign in to comment.