DEV Community

Idev.d
Idev.d

Posted on Originally published at idev.my

CI/CD with GitHub Actions: A Practical Setup for Small Teams

Our deployment used to be: local build, SCP to server, SSH to restart. 15 minutes per deploy, with production incidents from forgotten environment variables.

Now it is: git push, then tests, build, and deploy run automatically. Zero manual steps, 5 minutes total. Here is how we set it up at iDev.

Frontend Deployment (Vue + Vite)

The GitHub Actions workflow triggers on push to main. Steps: checkout, setup Node 20 with npm cache, run npm ci, lint, build, then SCP the dist folder to the production server and reload Nginx.

Backend Deployment (Spring Boot)

Similar workflow but with Java 17 and Maven. Key addition: a health check after restart that curls the health endpoint and fails the workflow if the service did not start properly.

Pro Tips

1. Cache Dependencies

Using the cache option in setup-node or setup-java saves 60+ seconds per run.

2. Path Filters

Only trigger backend deploy when backend files change. Add a paths filter so frontend changes do not trigger a backend rebuild.

3. Deploy Notifications

Send success or failure messages to your team Slack or Lark channel automatically.

4. Keep Last 5 Versions for Rollback

Copy the current JAR with a timestamp before deploying, then delete all but the 5 most recent backups.

5. Health Check After Deploy

Always verify the service actually started. If the health check fails, the workflow fails, and you get notified immediately.

Before and After

Metric Before After
Deploy time 15 min manual 5 min automated
Deploy frequency 1-2x/week 3-5x/day
Failed deploys 10%/month 1%/month
Rollback time 30 min 2 min

GitHub Actions is free for public repos. Private repos get 2,000 free minutes monthly. The ROI is immediate.


Small team, big output. iDev builds web apps, AI solutions and custom systems with startup speed and enterprise quality. Based in Malaysia, serving Southeast Asia. Free consultation.

Top comments (0)