hotfix: Resolved no matching version found #2
This file contains 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 | |
pull_request: | |
branches: | |
- main | |
jobs: | |
terraform: | |
name: Terraform Plan and Apply | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ap-southeast-2 | |
- name: Set up Terraform | |
uses: hashicorp/setup-terraform@v3 | |
- name: Terraform Format Check | |
run: terraform fmt -check | |
continue-on-error: true | |
- name: Terraform Validate | |
run: terraform validate | |
- name: Initialize Terraform | |
run: terraform init | |
- name: Terraform Plan | |
id: plan | |
run: terraform plan -no-color -out=tfplan | |
- name: Terraform Apply | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
run: terraform apply -auto-approve tfplan |