Merge pull request #1 from Victor-Borges-Silva/melhoria-tfvars #7
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: Terraform Apply | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
terraform-apply: | |
runs-on: ubuntu-latest | |
environment: prd | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Terraform | |
uses: hashicorp/setup-terraform@v2 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-west-1 | |
- uses: webfactory/[email protected] | |
with: | |
ssh-private-key: "${{ secrets.SSH_PRIVATE_KEY }}" | |
- name: Terraform Init | |
run: terraform init | |
- name: Terraform Plan | |
id: plan | |
run: terraform plan -out=plano | |
- name: Terraform Apply | |
run: terraform apply -auto-approve plano | |
- name: Clean up plan file | |
run: rm -f plano |