SanjaySinghRajpoot has started this #3
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 Deployment Pipeline to AWS | |
run-name: ${{github.actor}} has started this | |
on: | |
push: | |
branches: | |
- 'feature' | |
env: | |
AWS_ACCESS_KEY: ${{secrets.AWS_ACCESS_KEY}} | |
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}} | |
jobs: | |
build-infra: | |
name: terraform CI/CD | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: setting up terraform | |
uses: hashicorp/setup-terraform@v2 | |
- name: Terraform init | |
id: init | |
run: terraform init | |
working-directory: ./terraform-vpc | |
- name: Terraform Validate | |
id: validation | |
run: terraform validate | |
working-directory: ./terraform-vpc | |
- name: Terraform Plan | |
id: plan | |
run: terraform plan | |
working-directory: ./terraform-vpc | |
- name: Terraform Apply | |
id: apply | |
run: terraform apply --auto-approve | |
working-directory: ./terraform-vpc |