cd /news/developer-tools/auto-pr-auto-deploy-workflow-using-c… Β· home β€Ί topics β€Ί developer-tools β€Ί article
[ARTICLE Β· art-12430] src=dev.to β†— pub= topic=developer-tools verified=true sentiment=Β· neutral

Auto PR + Auto Deploy workflow using CI/CD Pipline

This article describes a production-style automated workflow using GitHub Actions that creates a pull request automatically when a feature branch is pushed, runs continuous integration checks (tests and linting) before merging, and then automatically deploys the application to production (using Vercel for frontend and Render for backend) once the PR is merged to the main branch. The setup includes branch protection rules, required secrets for deployment tokens, and a final architecture that ensures only clean, tested code reaches production.

read2 min views24 publishedMay 23, 2026

Here’s a real production-style Auto PR + Auto Deploy workflow using GitHub Actions. This is the kind of setup used in teams to keep main stable and deployments automatic. We’ll build it in 3 parts:

feature branch push
↓
Auto PR created (GitHub Action)
↓
CI runs (tests, lint)
↓
PR merged to main
↓
Auto deploy to production
---
This automatically creates a PR when you push a feature branch.
## πŸ“ `.github/workflows/auto-pr.yml`
``` yaml id="pr1"
name: Auto Create Pull Request
on:
push:
branches-ignore:
- main
jobs:
create-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create Pull Request
uses: repo-sync/pull-request@v2
with:
destination_branch: main
github_token: ${{ secrets.GITHUB_TOKEN }}
pr_title: "Auto PR: ${{ github.ref_name }}"
pr_body: |
## πŸ€– Auto-generated PR
Branch: `${{ github.ref_name }}`
Please review changes before merging.
feature/login
feature/login β†’ main
This ensures only clean code gets merged.
.github/workflows/ci.yml
``` yaml id="ci1"
name: CI Checks
on:
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm install
- name: Run lint
run: npm run lint
- name: Run tests
run: npm test
---
## 🧠 What this does:
Before merge:
* Runs lint checks
* Runs tests
* Blocks bad code from merging
---
This deploys your app when PR is merged.
## πŸ“ `.github/workflows/deploy.yml`
### Example: Deploy React + Node (Vercel + Render)
``` yaml id="deploy1"
name: Auto Deploy
on:
push:
branches: [ main ]
jobs:
deploy-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install frontend
working-directory: client
run: npm install
- name: Build frontend
working-directory: client
run: npm run build
- name: Deploy to Vercel
run: npx vercel --prod --token=${{ secrets.VERCEL_TOKEN }}
deploy-backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install backend
working-directory: server
run: npm install
- name: Deploy backend (Render webhook)
run: curl -X POST ${{ secrets.RENDER_DEPLOY_HOOK }}
Go to:
πŸ‘‰ Repo β†’ Settings β†’ Secrets β†’ Actions
Add:
``` plaintext id="sec1"
VERCEL_TOKEN=your_vercel_token
RENDER_DEPLOY_HOOK=https://api.render.com/deploy/xxx
---
## Developer flow:
``` plaintext id="flow2"
git checkout -b feature-login
git push origin feature-login
In GitHub:
Settings β†’ Branches β†’ main
Enable:
``` yaml id="notif1"
``` bash id="tag1"
git tag v1.0.0
git push origin v1.0.0
---
### ❌ Auto-deploy without tests
β†’ leads to broken production
### ❌ No branch protection
β†’ anyone can push to main
### ❌ Missing secrets
β†’ deployment fails silently
---
``` plaintext id="final1"
Feature Branch
↓
Auto PR Created
↓
CI (tests + lint)
↓
Review + Approval
↓
Merge to main
↓
CD Pipeline
↓
Frontend deploy (Vercel)
Backend deploy (Render/AWS)
↓
Slack/Discord notification
── more in #developer-tools 4 stories Β· sorted by recency
── more on @github actions 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/auto-pr-auto-deploy-…] indexed:0 read:2min 2026-05-23 Β· β€”