From 9dc349216b99ee7e605e285d7c05fa2d8eb1f14e Mon Sep 17 00:00:00 2001 From: j4y <36337+j4y@users.noreply.github.com> Date: Thu, 6 Nov 2025 21:41:08 -0500 Subject: [PATCH 1/2] fix: update deploy workflow to validate outputs --- .github/workflows/deploy.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2e9d273..717f36d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -70,15 +70,11 @@ jobs: bundle exec rake build - name: Validate Outputs - uses: actions/github-script@v6 - with: - script: | - const bucketName = steps.terragrunt_output.outputs.bucket_name; - const distributionId = steps.terragrunt_output.outputs.distribution_id; - - if (!bucketName || !distributionId) { - core.setFailed('Required outputs not found'); - } + run: | + echo "Verifying CloudFront Distribution..." + aws cloudfront get-distribution --id "${{ steps.terragrunt_output.outputs.distribution_id }}" + echo "\nVerifying S3 Bucket..." + aws s3 ls | grep "${{ steps.terragrunt_output.outputs.bucket_name }}" - name: Copy output to S3 run: aws s3 sync ./_site/ s3://${{ steps.terragrunt_output.outputs.bucket_name }} --acl public-read --delete --cache-control max-age=604800 From 942a46ec634f5fea687334ee315c12c7abb0a9f8 Mon Sep 17 00:00:00 2001 From: j4y <36337+j4y@users.noreply.github.com> Date: Thu, 6 Nov 2025 21:53:34 -0500 Subject: [PATCH 2/2] chore: configure routing rules in s3 website configuration --- terraform/website/main.tf | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/terraform/website/main.tf b/terraform/website/main.tf index b5698a7..815ea0d 100644 --- a/terraform/website/main.tf +++ b/terraform/website/main.tf @@ -38,6 +38,25 @@ resource "aws_s3_bucket_website_configuration" "bucket" { error_document { key = "error.html" } + + routing_rules = jsonencode([ + { + Condition { + KeyPrefixEquals = "colorcop/download" + } + Redirect { + ReplaceKeyWith = "download" + } + }, + { + Condition { + KeyPrefixEquals = "colorcop/features" + } + Redirect { + ReplaceKeyWith = "features" + } + } +]) } resource "aws_cloudfront_distribution" "distribution" {