Skip to content

Commit

Permalink
pull frontend info in separate step
Browse files Browse the repository at this point in the history
  • Loading branch information
jdbass committed Jun 6, 2024
1 parent 335744b commit c45f72b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,17 @@ jobs:
role-session-name: Appointment_GitHub_to_AWS_via_FederatedOIDC
aws-region: ${{ vars.AWS_REGION }}

- name: Get frontend bucket & distribution
id: get-frontend-resources
working-directory: ./tofu/environments/stage/services/frontend-infra
run: |
echo "bucket=$(terragrunt output bucket_name | tr -d '"')" >> $GITHUB_OUTPUT
echo "distribution=$(terragrunt output cloudfront_id)" >> $GITHUB_OUTPUT
- name: Deploy frontend to S3
run: |
cd tofu/environments/stage/services/frontend-infra
bucket=$(terragrunt output bucket_name | tr -d '"')
cloudfront=$(terragrunt output cloudfront_id)
aws s3 sync ../../../../../frontend/dist "s3://$(bucket)"
aws cloudfront create-invalidation --distribution-id $(cloudfront) --paths "/*"
aws s3 sync frontend/dist "s3://${{ steps.get-frontend-resources.outputs.bucket }}"
aws cloudfront create-invalidation --distribution-id ${{ steps.get-frontend-resources.outputs.distribution }} --paths "/*"
deploy-backend:
Expand Down

0 comments on commit c45f72b

Please sign in to comment.