Main #1
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
name: Main | |
on: | |
workflow_dispatch: | |
jobs: | |
deploy: | |
name: "Deploy" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "CONFIGURE SSH Key" | |
env: | |
PRIVATE_KEY: ${{ secrets.TF_SSH_PRIVATE_KEY }} | |
run: | | |
echo "$PRIVATE_KEY" > ~/.ssh/id_rsa | |
chmod 700 ~/.ssh/id_rsa | |
- name: "Set up Terraform" | |
uses: hashicorp/setup-terraform@v3 | |
with: | |
terraform_version: 1.9.8 | |
- name: "terraform commands" | |
run: | | |
terraform init | |
terraform plan -var digitalocean_access_token=$DIGITALOCEAN_ACCESS_TOKEN -out=tfplan | |
terraform apply tfplan -var digitalocean_access_token=$DIGITALOCEAN_ACCESS_TOKEN -auto-approve | |
env: | |
DIGITALOCEAN_ACCESS_TOKEN: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} |