From f62478f7c183511ac379d1a393399cea5a8c0873 Mon Sep 17 00:00:00 2001 From: Slesa Adhikari Date: Wed, 15 Nov 2023 15:41:44 -0600 Subject: [PATCH] Update action to deploy to a subpath --- .github/workflows/deploy.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 6673d7ab4..ba0a611be 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -79,7 +79,7 @@ jobs: GOOGLE_TAG_MANAGER_ID: ${{secrets.GOOGLE_TAG_MANAGER_ID}} GOOGLE_TAG_AUTH: ${{secrets.GOOGLE_TAG_AUTH}} GOOGLE_TAG_PREVIEW: ${{secrets.GOOGLE_TAG_PREVIEW}} - run: PUBLIC_URL="${{ vars.DOMAIN }}" yarn build + run: PUBLIC_URL="${{ vars.DOMAIN }}${{ vars.SUBPATH }}" yarn build # vars.SUBPATH should include the preceeding slash / deploy: runs-on: ubuntu-latest @@ -122,9 +122,11 @@ jobs: - name: Deploy to S3 Production run: | - aws s3 sync ./dist s3://${{ secrets.S3_BUCKET }} --cache-control max-age=604800 --delete + aws s3 sync ./dist s3://${{ secrets.S3_BUCKET }}${{ vars.SUBPATH }} --cache-control max-age=604800 --delete - name: Request Invalidation to AWS Cloudfront uses: oneyedev/aws-cloudfront-invalidation@v1 with: distribution-id: ${{ secrets.CF_DISTRIBUTION_ID }} + paths: | + "${{ vars.SUBPATH }}*"