Skip to content

CI/CD: GitHub Actions + auto-deploy to GCP VM#8

Merged
singhalvivek merged 6 commits into
mainfrom
cicd/deploy-to-vm
Jul 11, 2026
Merged

CI/CD: GitHub Actions + auto-deploy to GCP VM#8
singhalvivek merged 6 commits into
mainfrom
cicd/deploy-to-vm

Conversation

@singhalvivek

Copy link
Copy Markdown
Contributor

Adds CI + auto-deploy to the ir-civil-agent GCP VM.

Workflows

  • ci.yml — push/PR: frontend pnpm build + deterministic pytest tests/unit (no Gemini key → real-LLM tests auto-skip) + alembic migration smoke
  • ci-full.yml — nightly + manual: full real-Gemini suite
  • deploy.yml — push to main: build frontend → bundle → scp to VM → write .envuv sync + alembic upgrade → restart ir-agent systemd service (gcloud service-account auth)

deploy/

bootstrap.sh (one-time VM setup), ir-agent.service (systemd), deploy-remote.sh (on-VM step), README.md.

Setup already done

  • Repo variables set (GCP_SA_KEY, AGENT_GEMINI_API_KEY, GCP_PROJECT/ZONE/INSTANCE)
  • Firewall opened for tcp:8001
  • VM bootstrapped (swap, libs, uv, iragent user, systemd unit)

Merging triggers the first deploy → app at http://34.136.42.41:8001/app/

🤖 Generated with Claude Code

singhalvivek and others added 6 commits July 11, 2026 13:55
- ci.yml: fast gate on push/PR — frontend pnpm build + deterministic
  backend `pytest tests/unit` (no Gemini key → real-LLM tests auto-skip)
  + alembic migration smoke.
- ci-full.yml: full real-Gemini suite, nightly + manual.
- deploy.yml: on merge to main — build frontend, bundle app, scp to the
  ir-civil-agent VM, write .env from secrets, uv sync + alembic upgrade,
  restart the ir-agent systemd service (auth via gcloud service account).
- deploy/: bootstrap.sh (one-time VM setup), ir-agent.service (systemd),
  deploy-remote.sh (on-VM deploy step), README.md (secrets/vars + steps).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Shell scripts and the systemd unit run on the Linux VM; CRLF would break
them regardless of a contributor's local core.autocrlf.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The deploy config stores these as repository variables (user choice),
so reference them via vars.* — secrets.* would resolve empty.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The VM base image (Ubuntu questing) has no python3.11 package, and uv
fetches a standalone CPython >=3.11 per pyproject anyway. Keeps bootstrap
independent of the base image's Python version.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…mat)

frontend/pnpm-workspace.yaml uses the pnpm v10+ settings schema
(allowBuilds, no packages field). pnpm 9 rejected it with "packages
field missing or empty". Pin to 11 to match the local toolchain + lockfile.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
pnpm 11 requires the node:sqlite built-in (Node 22+). Node 20 crashed
with ERR_UNKNOWN_BUILTIN_MODULE. Node 24 also clears the runner's
Node 20 deprecation warnings; Next 15 builds fine on it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@singhalvivek
singhalvivek merged commit 41ecfa4 into main Jul 11, 2026
4 checks 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