Skip to content
Merged

fixup #239

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 19 additions & 0 deletions terraform/website/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
Loading