Skip to content

fixup

fixup #167

Workflow file for this run

name: Deploy

Check failure on line 1 in .github/workflows/deploy.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/deploy.yml

Invalid workflow file

(Line: 32, Col: 5): 'steps' is already defined
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
TG_WORKING_DIR: terragrunt/live/website
concurrency:
group: ${{ github.workflow }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
steps:
- uses: actions/checkout@v5
with:
submodules: true
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Install Terragrunt and OpenTofu
uses: gruntwork-io/terragrunt-action@v3
with:
terraform_version: '1.13.4'
terragrunt_version: '0.86.0'
- name: Update Terraform State and Providers
run: |
cd "$TG_WORKING_DIR"
ls -la
terragrunt init --upgrade
- name: Terragrunt Plan
run: terragrunt plan --chdir $TG_WORKING_DIR
- name: Terragrunt Apply
run: terragrunt apply -auto-approve --chdir $TG_WORKING_DIR
- name: Terragrunt Output
id: terraform
run: |
printf "distribution_id=%s\n" $(terragrunt output --chdir $TG_WORKING_DIR distribution_id) >> "$GITHUB_OUTPUT"
printf "bucket_name=%s\n" $(terragrunt output --chdir $TG_WORKING_DIR bucket_name) >> "$GITHUB_OUTPUT"
- name: Build Jekyll project
run: bundle exec rake build
- name: Copy output to S3
run: aws s3 sync ./_site/ s3://${{ steps.terraform.outputs.bucket_name }} --acl public-read --delete --cache-control max-age=604800
- name: Invalidate Cloudfront
run: aws cloudfront create-invalidation --distribution-id ${{ steps.terraform.outputs.distribution_id }} --paths "/*"