Retry failed CF cache invalidations (#2957)

This commit is contained in:
Cezary Miącz 2023-01-12 11:42:13 +01:00 committed by GitHub
parent b17f6e735b
commit f02a5a32e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 7 deletions

View file

@ -62,9 +62,9 @@ jobs:
aws s3 sync build/dashboard s3://${BUCKET}/${ENVIRONMENT}/static/
aws s3 cp build/dashboard/index.html s3://${BUCKET}/${ENVIRONMENT}/
aws cloudfront create-invalidation --distribution-id ${CF_ID} --paths "/dashboard*"
for i in {1..3}; do aws cloudfront create-invalidation --distribution-id ${CF_ID} --paths "/dashboard*" && break || sleep 5; done
if [[ -n "$CF_2_ID" ]]; then
aws cloudfront create-invalidation --distribution-id ${CF_2_ID} --paths "/dashboard*"
for i in {1..3}; do aws cloudfront create-invalidation --distribution-id ${CF_2_ID} --paths "/dashboard*" && break || sleep 5; done
fi
- name: Notify Slack
if: ${{ always() }}

View file

@ -2,7 +2,7 @@ name: Deploy to staging demo
on:
push:
tags:
- 3.8**
- 3.9**
workflow_dispatch:
inputs:
git_ref:
@ -54,7 +54,7 @@ jobs:
run: |
aws s3 sync build/dashboard s3://${{ secrets.AWS_DEMO_STAGING_DEPLOYMENT_BUCKET }}/dashboard/static/
aws s3 cp build/dashboard/index.html s3://${{ secrets.AWS_DEMO_STAGING_DEPLOYMENT_BUCKET }}/dashboard/
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DEMO_STAGING_CF_DIST_ID }} --paths "/dashboard*"
for i in {1..3}; do aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DEMO_STAGING_CF_DIST_ID }} --paths "/dashboard*" && break || sleep 5; done
- name: Prepare Demo release pull request
run: |
export GITHUB_TOKEN=$( \

View file

@ -49,7 +49,7 @@ jobs:
run: |
aws s3 sync build/dashboard s3://${{ secrets.AWS_DEMO_DEPLOYMENT_BUCKET }}/dashboard/static/
aws s3 cp build/dashboard/index.html s3://${{ secrets.AWS_DEMO_DEPLOYMENT_BUCKET }}/dashboard/
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DEMO_CF_DIST_ID }} --paths "/dashboard*"
for i in {1..3}; do aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DEMO_CF_DIST_ID }} --paths "/dashboard*" && break || sleep 5; done
- name: Notify Slack
if: ${{ always() }}
env:

View file

@ -50,7 +50,7 @@ jobs:
run: |
aws s3 sync build/dashboard s3://${{ secrets.AWS_STAGING_DEPLOYMENT_BUCKET }}/${ENVIRONMENT}/static/
aws s3 cp build/dashboard/index.html s3://${{ secrets.AWS_STAGING_DEPLOYMENT_BUCKET }}/${ENVIRONMENT}/
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_STAGING_CF_DIST_ID }} --paths "/dashboard*"
for i in {1..3}; do aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_STAGING_CF_DIST_ID }} --paths "/dashboard*" && break || sleep 5; done
- name: Notify Slack
if: ${{ always() }}

View file

@ -68,7 +68,7 @@ jobs:
run: |
aws s3 sync build/dashboard s3://${{ secrets.AWS_STAGING_DEPLOYMENT_BUCKET }}/${ENVIRONMENT}/static/
aws s3 cp build/dashboard/index.html s3://${{ secrets.AWS_STAGING_DEPLOYMENT_BUCKET }}/${ENVIRONMENT}/
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_STAGING_CF_DIST_ID }} --paths "/dashboard*"
for i in {1..3}; do aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_STAGING_CF_DIST_ID }} --paths "/dashboard*" && break || sleep 5; done
- name: Prepare Sandbox release pull request
run: |