From a1f5344a4999e49f311638420675e38d6e70f874 Mon Sep 17 00:00:00 2001 From: danilapog Date: Thu, 4 Jul 2024 16:38:04 +0300 Subject: [PATCH] Sync actual build artifacts with s3 bucket --- .github/workflows/publish.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index bf39b8136..586476195 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -24,6 +24,21 @@ jobs: working-directory: site run: pnpm build + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-east-1 + + - name: Sync bucket + run: | + cd ./site/dist + aws s3 sync . s3://api2static.teamlab.info --delete + + - name: Invalidate CLOUDFRONT cache + run: aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DISTRIBUTION_ID }} + # - name: Publish Site # Once the content has been built, you can find it in the `./site/dist` # directory. Be aware that this directory could contain as many as 5000