# Set Up a CI/CD Pipeline in 10 Minutes with PandaStack and GitHub
Continuous deployment is the practice of automatically shipping code to production every time tests pass on the main branch. It sounds complex, but with PandaStack and GitHub, the core pipeline takes about 10 minutes to set up.
1. Connect Your GitHub Repository to PandaStack
This is the foundation. PandaStack watches your GitHub repository and deploys on every push.
- 1Log in to [dashboard.pandastack.io](https://dashboard.pandastack.io)
- 2Click New Deployment → select your deployment type (Static Site or Container App)
- 3Click Connect GitHub and authorize PandaStack
- 4Select your repository and the branch to deploy from (usually
main)
From this point, every push to main triggers a deploy.
2. Configure Build Settings
Tell PandaStack how to build your application:
| Application Type | Build Command | Output |
|---|---|---|
| React (CRA) | npm run build | build/ |
| React (Vite) | npm run build | dist/ |
| Next.js (static) | npm run build | out/ |
| Container app | (uses Dockerfile) | — |
For container apps, simply ensure a valid Dockerfile is in your repository root.
3. Add Environment Variables
Add your production environment variables in the deployment settings before your first deploy:
DATABASE_URL— managed database connection string from PandaStackAPI_KEY— third-party service credentialsNODE_ENV=production
These are encrypted and injected at build/runtime without appearing in logs.
4. Add GitHub Actions for Tests (Optional but Recommended)
The PandaStack GitHub integration deploys on every push. To only deploy after tests pass, add a GitHub Actions workflow that runs tests before pushing:
# .github/workflows/ci.yml
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npm test -- --ci --coverage
- run: npm run lintThis workflow runs on every push and pull request. If tests fail, the push to main is blocked (via branch protection rules), preventing a broken deploy.
5. Set Up Branch Protection
To enforce tests before deploy:
- 1Go to your GitHub repository → Settings → Branches
- 2Add a branch protection rule for
main - 3Enable Require status checks to pass before merging
- 4Select your CI workflow as a required check
- 5Enable Require branches to be up to date before merging
Now the only way code reaches main is through a pull request that passes all tests.
6. Environment-Specific Deployments
Use separate branches for separate environments:
main→ production deployment on PandaStackstaging→ staging deployment on PandaStack (create a separate deployment)- Feature branches → no automatic deploy (use PRs)
In PandaStack, create a second deployment for your staging environment connected to the staging branch. Each environment has its own environment variables and database.
7. Rollback in One Click
If a bad deploy reaches production, you do not need to revert the Git commit and wait for a new build. PandaStack keeps a history of previous deployments:
- 1Go to your deployment → Deployment History
- 2Find the last known-good deploy
- 3Click Redeploy
The previous version is live in about 30 seconds.
8. Deployment Notifications
Configure alerts so your team knows when deploys succeed or fail:
- 1Go to your deployment → Notifications
- 2Add a Slack webhook URL, email address, or custom webhook endpoint
- 3Choose events: deploy started, deploy succeeded, deploy failed
This closes the feedback loop — your team knows the moment code ships, and knows immediately if something goes wrong.
Full docs: [docs.pandastack.io](https://docs.pandastack.io).