Skip to content

Commit

Permalink
Add workflow file
Browse files Browse the repository at this point in the history
  • Loading branch information
jaezeu committed Jun 24, 2024
1 parent 84e1283 commit f874a8b
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Terraform Deployment

on:
push:
branches: [ "main" ]

env:
AWS_REGION: ap-southeast-1

jobs:
CICD:
runs-on: ubuntu-latest

steps:
- name: Checkout
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: ${{ env.AWS_REGION }}

- name: Setup Terraform
uses: hashicorp/setup-terraform@v2

- name: Terraform fmt
run: terraform fmt --recursive

- name: Terraform Init
run: terraform init

- name: Terraform Validate
run: terraform validate

- name: Terraform Plan
run: terraform plan

- name: Terraform Apply
run: terraform apply --auto-approve

0 comments on commit f874a8b

Please sign in to comment.