-
Notifications
You must be signed in to change notification settings - Fork 1
26 lines (24 loc) · 1.07 KB
/
create-sit.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
name: Create SIT
on: workflow_dispatch
jobs:
create-sit-servers:
name: Create SIT Servers
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/testing-sit' # Only apply changes on main branch
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
AWS_DEFAULT_REGION: ap-southeast-1 # Replace with your AWS region
TF_WORKING_DIR: ./terraform/sit # Adjust to your Terraform directory
steps:
- name: Checkout Cocde
uses: actions/checkout@v4
- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
- name: Terraform Init
working-directory: ${{ env.TF_WORKING_DIR }}
run: terraform init
- name: Terraform Apply
working-directory: ${{ env.TF_WORKING_DIR }}
run: terraform apply -auto-approve -auto-approve -var='access-key=${AWS_ACCESS_KEY_ID}' -var='secret-key=${AWS_SECRET_ACCESS_KEY}' -var='db_username=admin' -var='db_password=${DB_PASSWORD}' -var='my_ip='192.168.0.147'