Skip to content

Commit

Permalink
Update action to deploy to a subpath
Browse files Browse the repository at this point in the history
  • Loading branch information
slesaad committed Nov 15, 2023
1 parent 22eb502 commit f62478f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}*"

0 comments on commit f62478f

Please sign in to comment.