forked from h2ouw8n4/wordpressOnAWS
-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (28 loc) · 1.11 KB
/
build-all.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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@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@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 }}'