Skip to content

Step19: Add terraform and deploy workflow#23

Merged
Parth576 merged 2 commits intomainfrom
step19
Mar 7, 2026
Merged

Step19: Add terraform and deploy workflow#23
Parth576 merged 2 commits intomainfrom
step19

Conversation

@Parth576
Copy link
Owner

@Parth576 Parth576 commented Mar 6, 2026

No description provided.

Parth576 added 2 commits March 5, 2026 08:49
Terraform config for e2-micro VM in us-central1-a with 30GB disk,
firewall rules (SSH + 8080), deploy service account with minimal
IAM roles, and systemd startup script. README documents full GCP
setup, service account permissions, and GitHub Actions secrets.
Build static Go binary on push to main (backend/** path filter),
SCP to GCP VM, restart systemd service, and verify health check.
Runs tests before deploy. Supports manual workflow_dispatch.
Updates infra README with SSH key setup and deploy secrets.
push:
branches: [main]
paths: [backend/**]
workflow_dispatch:
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this empty workflow dispatch key?


concurrency:
group: deploy-backend
cancel-in-progress: false
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this concurrency block do? it should queue if there is an existing deployment not deploy 2 pipelines at the same time

go-version-file: go.mod

- name: Build static binary
run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o smolterms ./backend/cmd/server/main.go
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does the CGO_ENabled=0 flag do

ports = ["22"]
}

source_ranges = ["0.0.0.0/0"]
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can i use a env var from github env vars over here to set this to my own public ip?

@Parth576 Parth576 merged commit 910b848 into main Mar 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant