-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from sayoungestguy/develop
Deploy to prod
- Loading branch information
Showing
318 changed files
with
31,927 additions
and
645 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Destroy SIT | ||
|
||
on: | ||
workflow_dispatch: | ||
branches: | ||
- ci-cd | ||
|
||
jobs: | ||
terraform-destroy: | ||
name: Terraform Destroy | ||
runs-on: ubuntu-latest | ||
|
||
# Environment variables for AWS credentials and region | ||
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 repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Terraform | ||
uses: hashicorp/setup-terraform@v2 | ||
with: | ||
terraform_wrapper: false # Optional: disable wrapper script | ||
terraform_version: 1.9.6 # Replace with your Terraform version | ||
|
||
- name: Initialize Terraform | ||
working-directory: ${{ env.TF_WORKING_DIR }} | ||
run: terraform init | ||
|
||
- name: Validate Terraform configuration | ||
working-directory: ${{ env.TF_WORKING_DIR }} | ||
run: terraform validate | ||
|
||
- name: Terraform Destroy | ||
working-directory: ${{ env.TF_WORKING_DIR }} | ||
run: terraform destroy -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' |
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
Oops, something went wrong.