fix: SRI hashes #230
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: | |
| - main | |
| # branches that match deploy-* will deploy as well | |
| - deploy-* | |
| workflow_dispatch: | |
| env: | |
| # AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| # AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| # AWS_DEFAULT_REGION: us-east-1 | |
| working_dir: terragrunt/live/website | |
| concurrency: | |
| group: ${{ github.workflow }} | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Configure AWS Credentials | |
| uses: aws-actions/configure-aws-credentials@v5.1.1 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: us-east-1 | |
| - name: Update Terraform State and Providers | |
| uses: gruntwork-io/terragrunt-action@v3 | |
| with: | |
| tg_dir: ${{ env.working_dir }} | |
| tg_command: init --upgrade | |
| - name: Terragrunt Plan | |
| uses: gruntwork-io/terragrunt-action@v3 | |
| with: | |
| tg_dir: ${{ env.working_dir }} | |
| tg_command: plan | |
| - name: Terragrunt Apply | |
| uses: gruntwork-io/terragrunt-action@v3 | |
| with: | |
| tg_dir: ${{ env.working_dir }} | |
| tg_command: apply | |
| # - name: Terragrunt Output | |
| # uses: gruntwork-io/terragrunt-action@v3 | |
| # env: | |
| # TG_TF_FORWARD_STDOUT: 1 | |
| # TG_NO_COLOR: 1 | |
| # with: | |
| # tg_dir: ${{ env.working_dir }} | |
| # tg_command: output | |
| - name: Read Values | |
| id: terragrunt_output | |
| run: | | |
| cd terragrunt/live/website | |
| printf "distribution_id=%s\n" $(terragrunt output distribution_id) >> "$GITHUB_OUTPUT" | |
| printf "bucket_name=%s\n" $(terragrunt output bucket_name) >> "$GITHUB_OUTPUT" | |
| - name: Build Jekyll project | |
| run: | | |
| bundle install | |
| bundle exec rake build | |
| - name: Validate Outputs | |
| 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 | |
| - name: Invalidate Cloudfront | |
| run: aws cloudfront create-invalidation --distribution-id ${{ steps.terragrunt_output.outputs.distribution_id }} --paths "/*" |