Description → One Repo → Multiple Branch → One Droplet → Multiple Domain
First Script → Setup our project Environment
Second Script → Run Project
Download Terraform
Extract zip file
→ run terraform.exe
check terraform version
Download terraform code from here
Create API Tokens in Digital Ocean
Go to and log in to your account. Expiration :- 30/60/90 days and No Expire Set Permissions :- full access
Go to AWS Console
go to security credentials
Go to Users
Create access key
Create Access key
Copy Access Key & Secret Access Key
Secret Name
Go to secret Manager → select Secret Store a new Secret
add env in key pair values or plaintext that support json format
add name
Click Next
Store the Secret
env-test →secret_name
Create terraform.tfvars file
do_token = "" #API TOKEN
ssh_public_key_path = "" #public_key_path
ssh_private_key_path = ""#private_key_path
droplet_image = "ubuntu-24-04-x64"
droplet_name = "web-server" #droplet_name
droplet_region = "blr1"
droplet_size = "s-1vcpu-1gb"
aws_access_key = " " #access_key
aws_secret_key = "" #secret_key
aws_region = "us-east-1" # region
node_version = "18"
dragonfly_repo = "git@github.com:owner/repo_name.git" #repo name
dragonfly_port = port of dragonfly
dragonfly_domain = "" # Domain name
dragonfly_secret = "" #secret name
dragonfly_branch = "" #branch name
firefly_repo = "git@github.com:owner/repo_name.git" #repo name
firefly_port = port of firefly
firefly_domain = "" # Domain name
firefly_secret = "" #secret name
firefly_branch = "" #branch name
Save the file
→ Open Terminal in that Folder
apply → Create Droplet Server & install dependencies
Run repo name wise
Run Dragonfly
terraform apply -var="app_action=setup_dragonfly"
terraform apply -var="app_action=destroy_dragonfly"
Run Firefly
terraform apply -var="app_action=setup_firefly"
terraform apply -var="app_action=destroy_firefly"