Skip to content

feat: auto-deploy to production after images are built#442

Merged
its-me-abhishek merged 1 commit intomainfrom
feature/auto-deploy
Jan 31, 2026
Merged

feat: auto-deploy to production after images are built#442
its-me-abhishek merged 1 commit intomainfrom
feature/auto-deploy

Conversation

@cfsmp3
Copy link
Copy Markdown
Collaborator

@cfsmp3 cfsmp3 commented Jan 31, 2026

Summary

Makes deployment fully automatic by adding a deploy job to the Docker build workflow.

Before: Push to main → images built → manual trigger required to deploy
After: Push to main → images built → auto-deploy to production

How It Works

push to main
    ↓
┌─────────────────────────────────────┐
│  build-and-push-frontend (parallel) │
│  build-and-push-backend  (parallel) │
└─────────────────────────────────────┘
    ↓ (both must succeed)
┌─────────────────────────────────────┐
│  deploy                             │
│  - SSH to VPS                       │
│  - Run deploy.sh with commit SHA    │
│  - Health check + auto-rollback     │
└─────────────────────────────────────┘

Safety

  • Deploy only runs if both build jobs succeed
  • Uses commit SHA as image tag (immutable)
  • deploy.sh has automatic rollback on health check failure
  • GitHub environment protection can add required reviewers if needed

Test plan

🤖 Generated with Claude Code

Add a deploy job that automatically deploys to production after
both frontend and backend images are built and pushed to GHCR.

The deploy job:
- Waits for both build jobs to complete
- Uses the production environment (for SSH credentials)
- Runs deploy.sh with the commit SHA as the image tag
- Provides a deployment summary in the workflow

This makes deployment fully automatic: push to main → build → deploy.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Thank you for opening this PR!

Before a maintainer takes a look, it would be really helpful if you could walk through your changes using GitHub's review tools.

Please take a moment to:

  • Check the "Files changed" tab
  • Leave comments on any lines for functions, comments, etc. that are important, non-obvious, or may need attention
  • Clarify decisions you made or areas you might be unsure about and/or any future updates being considered.
  • Finally, submit all the comments!

More information on how to conduct a self review:
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/reviewing-proposed-changes-in-a-pull-request

This helps make the review process smoother and gives us a clearer understanding of your thought process.

Once you've added your self-review, we'll continue from our side. Thank you!

@its-me-abhishek its-me-abhishek merged commit aa45761 into main Jan 31, 2026
6 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.

2 participants