Skip to content

Build Docker and Apply Terraform Changes to AWS #50

Build Docker and Apply Terraform Changes to AWS

Build Docker and Apply Terraform Changes to AWS #50

Workflow file for this run

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@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: ${{ secrets.AWS_REGION }}
# execute Terraform
- name: Install Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: latest
- name: Terraform Init
run: terraform init
- name: Terraform Plan
run: terraform plan -input=false -var 'site_domain=${{ secrets.TF_VAR_SITE_DOMAIN }}' -var 'public_alb_domain=${{ secrets.TF_VAR_PUBLIC_ALB_DOMAIN }}'
- name: Terraform Apply
run: terraform apply -auto-approve -var 'site_domain=${{ secrets.TF_VAR_SITE_DOMAIN }}' -var 'public_alb_domain=${{ secrets.TF_VAR_PUBLIC_ALB_DOMAIN }}'