Skip to content

Commit

Permalink
terraform docker and github secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
loftwah committed Aug 2, 2024
1 parent b5d0404 commit 92bfbac
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
14 changes: 13 additions & 1 deletion terraform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,16 @@ terraform init
terraform apply -var="do_token=YOUR_DIGITALOCEAN_TOKEN"

ssh root@<ip-address>
```
```

* Create the instance with Terraform
* Collect the droplet IP address
* Check for access `ssh root@<ip-address>`

## GitHub Secrets

Ensure you have the following secrets set in your GitHub repository:

* `DROPLET_IP`: The IP address of your DigitalOcean Droplet.
* `DROPLET_SSH_PRIVATE_KEY`: The private SSH key to access your DigitalOcean Droplet.
* `GH_PAT`: Your GitHub Personal Access Token.
3 changes: 2 additions & 1 deletion terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ resource "digitalocean_droplet" "web" {
ssh_keys = [var.ssh_key_id]
user_data = <<-EOF
#!/bin/bash
# Install Docker
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
EOF
}
}

0 comments on commit 92bfbac

Please sign in to comment.