Skip to content

Issue 29: CI/CD Deployment Workflow #29

@laraibg786

Description

@laraibg786

Goal

Build a GitHub Actions CI/CD workflow to test, build a Docker image, and deploy to the Hetzner VPS on every push to main, with health checks and automatic rollback on failure.

Requirements

Functional

  • Test job: Run pytest, ruff, and black --check on every push.
  • Build job: Build Docker image tagged with commit SHA; push to registry.
  • Deploy job: SSH to Hetzner VPS, pull new image, restart services via Docker Compose.
  • Health check: Verify GET /health returns 200 within 30 seconds post-deploy.
  • Rollback: Revert to previous image if health check fails; send alert.

Technical

  • Workflow file: .github/workflows/deploy.yml.
  • Secrets: DOCKER_USERNAME, DOCKER_PASSWORD, DOCKER_REGISTRY, HETZNER_SSH_KEY, HETZNER_HOST.
  • Registry: Docker Hub or private registry.

Acceptance Criteria

  • Push to main triggers full test → build → deploy pipeline.
  • Failed tests block deployment.
  • Health check passes after successful deployment.
  • Failed health check triggers rollback to previous image.

Dependencies

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions