Skip to content

Commit ae493c7

Browse files
committed
test
1 parent 2e5d6f5 commit ae493c7

1 file changed

Lines changed: 21 additions & 7 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,31 @@ jobs:
5050
tg_dir: ${{ env.working_dir }}
5151
tg_command: apply -auto-approve
5252

53-
- name: Terragrunt Output
54-
id: terraform
55-
run: |
56-
printf "distribution_id=%s\n" $(terragrunt output --chdir $TG_WORKING_DIR distribution_id) >> "$GITHUB_OUTPUT"
57-
printf "bucket_name=%s\n" $(terragrunt output --chdir $TG_WORKING_DIR bucket_name) >> "$GITHUB_OUTPUT"
53+
- name: Get bucket name
54+
uses: gruntwork-io/terragrunt-action@v3
55+
id: get_bucket_name
56+
with:
57+
tg_dir: ${{ env.TG_WORKING_DIR }}
58+
tg_command: 'output bucket_name'
59+
60+
- name: Get distribution id
61+
uses: gruntwork-io/terragrunt-action@v3
62+
id: get_distribution_id
63+
with:
64+
tg_dir: ${{ env.TG_WORKING_DIR }}
65+
tg_command: 'output distribution_id'
66+
67+
# - name: Terragrunt Output
68+
# id: terraform
69+
# run: |
70+
# printf "distribution_id=%s\n" $(terragrunt output --chdir $TG_WORKING_DIR distribution_id) >> "$GITHUB_OUTPUT"
71+
# printf "bucket_name=%s\n" $(terragrunt output --chdir $TG_WORKING_DIR bucket_name) >> "$GITHUB_OUTPUT"
5872

5973
- name: Build Jekyll project
6074
run: bundle exec rake build
6175

6276
- name: Copy output to S3
63-
run: aws s3 sync ./_site/ s3://${{ steps.terraform.outputs.bucket_name }} --acl public-read --delete --cache-control max-age=604800
77+
run: aws s3 sync ./_site/ s3://${{ steps.get_bucket_name.outputs.tg_action_output }} --acl public-read --delete --cache-control max-age=604800
6478

6579
- name: Invalidate Cloudfront
66-
run: aws cloudfront create-invalidation --distribution-id ${{ steps.terraform.outputs.distribution_id }} --paths "/*"
80+
run: aws cloudfront create-invalidation --distribution-id ${{ steps.get_distribution_id.outputs.tg_action_output }} --paths "/*"

0 commit comments

Comments
 (0)