Skip to content

Commit

Permalink
Merge pull request #38 from gnosischain/feature/improve-ci
Browse files Browse the repository at this point in the history
CI: add cache invalidation
  • Loading branch information
giacomognosis authored May 27, 2024
2 parents 45e4757 + 1c06c25 commit ed2d437
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,18 @@ jobs:
- name: 'Deploy to S3: Development'
if: github.ref == 'refs/heads/dev'
run: |
aws s3 sync build/ s3://${{ secrets.DEV_BUCKET_NAME }}/dev --exclude "*.html" --cache-control max-age=0,no-cache,no-store,public
aws s3 sync build/ s3://${{ secrets.DEV_BUCKET_NAME }}/dev --exclude "*" --include "*.html" --cache-control max-age=0,no-cache,no-store,must-revalidate --content-type text/html
aws s3 sync build/ s3://${{ secrets.DEV_BUCKET_NAME }}/dev --exclude "*.html" --cache-control max-age=0,no-cache,no-store,public --delete
aws s3 sync build/ s3://${{ secrets.DEV_BUCKET_NAME }}/dev --exclude "*" --include "*.html" --cache-control max-age=0,no-cache,no-store,must-revalidate --content-type text/html --delete
aws s3 sync data s3://${{ secrets.DEV_BUCKET_NAME }}/dev/data --delete
# Script to deploy to staging environment
- name: 'Deploy to S3: Staging'
if: github.ref == 'refs/heads/main'
run: |
aws s3 sync build/ s3://${{ secrets.DEV_BUCKET_NAME }}/main --exclude "*.html" --cache-control max-age=0,no-cache,no-store,public
aws s3 sync build/ s3://${{ secrets.DEV_BUCKET_NAME }}/main --exclude "*" --include "*.html" --cache-control max-age=0,no-cache,no-store,must-revalidate --content-type text/html
aws s3 sync data s3://${{ secrets.DEV_BUCKET_NAME }}/main/data --delete
aws s3 sync build/ s3://${{ secrets.DEV_BUCKET_NAME }}/main --exclude "*.html" --cache-control max-age=0,no-cache,no-store,public --delete
aws s3 sync build/ s3://${{ secrets.DEV_BUCKET_NAME }}/main --exclude "*" --include "*.html" --cache-control max-age=0,no-cache,no-store,must-revalidate --content-type text/html --delete
aws s3 sync data s3://${{ secrets.DEV_BUCKET_NAME }}/main/data --delete
- name: 'Cloudfront: cache invalidation'
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.DEV_AWS_CLOUDFRONT_ID }} --paths "/*"
4 changes: 4 additions & 0 deletions .github/workflows/prod_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ jobs:
aws s3 sync build/ s3://${{ secrets.RELEASE_BUCKET_NAME }} --delete --exclude "*" --include "sitemap.xml" --cache-control max-age=0,no-cache,no-store,must-revalidate --content-type text/xml
aws s3 sync data s3://${{ secrets.RELEASE_BUCKET_NAME }}/data --delete
- name: 'Cloudfront: cache invalidation'
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.PROD_AWS_CLOUDFRONT_ID }} --paths "/*"
notify:
uses: ./.github/workflows/slack_release_notification.yml
if: ${{ always() }}
Expand Down

0 comments on commit ed2d437

Please sign in to comment.