From 8274b5b72a04205c7e10c0d88eac1c3451f1dc7b Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Thu, 16 Nov 2023 10:47:32 -0500 Subject: [PATCH] Clean output folder before copying contents from build output (#168) --- .github/workflows/deploy-production.yml | 1 + .github/workflows/deploy-staging.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml index 302f8e855..4298e4b2c 100644 --- a/.github/workflows/deploy-production.yml +++ b/.github/workflows/deploy-production.yml @@ -24,5 +24,6 @@ jobs: aws-access-key-id: ${{ secrets.AWS_S3_PRODUCTION_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_S3_PRODUCTION_SECRET }} aws-region: eu-west-1 + - run: aws s3 rm ${{ secrets.AWS_S3_STAGE_PATH }}/* - run: aws s3 sync ./build ${{ secrets.AWS_S3_PRODUCTION_PATH }} - run: aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DISTRIBUTION_PRODUCTION }} --paths '/*' diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index 887de544c..3ecb27c00 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -24,5 +24,6 @@ jobs: aws-access-key-id: ${{ secrets.AWS_S3_STAGE_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_S3_STAGE_SECRET }} aws-region: eu-west-1 + - run: aws s3 rm ${{ secrets.AWS_S3_STAGE_PATH }}/* - run: aws s3 sync ./build ${{ secrets.AWS_S3_STAGE_PATH }} - run: aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DISTRIBUTION_STAGE }} --paths '/*'