Build Docker and Apply Terraform Changes to AWS #38
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: Build Docker and Apply Terraform Changes to AWS | |
on: | |
workflow_dispatch: | |
push: | |
paths-ignore: | |
- 'docker/**' # Exclude changes made in the specific directory | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
# execute Terraform | |
- name: Install Terraform | |
uses: hashicorp/setup-terraform@v1 | |
with: | |
terraform_version: latest | |
- name: Terraform Init | |
run: terraform init | |
- name: Terraform Plan | |
run: terraform plan | |
- name: Terraform Apply | |
run: terraform apply -auto-approve |