deploy #181
Workflow file for this run
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 | |
| 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@v5 | |
| - name: Update Terraform State and Providers | |
| uses: gruntwork-io/terragrunt-action@v3 | |
| env: | |
| TF_LOG: DEBUG | |
| INPUT_PRE_EXEC_1: | | |
| echo "Current directory: $(pwd)" | |
| ls -la | |
| git status | |
| 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 -auto-approve | |
| # - name: Get bucket name | |
| # uses: gruntwork-io/terragrunt-action@v3 | |
| # id: get_bucket_name | |
| # with: | |
| # tg_dir: ${{ env.working_dir }} | |
| # tg_command: output bucket_name | |
| # - name: Get distribution id | |
| # uses: gruntwork-io/terragrunt-action@v3 | |
| # id: get_distribution_id | |
| # with: | |
| # tg_dir: ${{ env.working_dir }} | |
| # tg_command: output distribution_id | |
| # - 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.get_bucket_name.outputs.tg_action_output }} --acl public-read --delete --cache-control max-age=604800 | |
| # - name: Invalidate Cloudfront | |
| # run: aws cloudfront create-invalidation --distribution-id ${{ steps.get_distribution_id.outputs.tg_action_output }} --paths "/*" |