Organized docs into logical subdirectories:
**New Structure:**
- docs/
- README.md (index with quick links)
- PROJECT_PLAN.md (root level - main roadmap)
- development/
- getting-started.md (5-min quickstart)
- local-setup.md (detailed Docker Compose guide)
- workflow.md (daily development)
- git-workflow.md (branching strategy)
- architecture/
- overview.md (tech stack, design)
- database.md (schema, RLS, migrations)
- api.md (endpoints, functions)
- deployment/
- production.md (Docker, Coolify)
- ci-cd.md (automated pipelines)
**Cleaned Up:**
- Moved DEV_SETUP.md → docs/development/local-setup.md
- Removed outdated SETUP.md (referenced old Coolify setup)
- Replaced with getting-started.md (current Docker Compose flow)
- Updated README.md links to new structure
All paths tested, no broken links.
6.8 KiB
Pantry - CI/CD Pipeline
Version: 1.0
Last Updated: 2026-02-08
🔄 Overview
Pantry uses Gitea Actions for CI/CD, automatically deploying to Coolify on push.
Workflow Strategy
Feature Branch → PR → Code Review → Merge → Auto-Deploy
↓
PR Checks
(no deploy)
Environments:
- Development (
developbranch) → Auto-deploy to dev.pantry - Production (
mainbranch) → Auto-deploy to pantry - Test (manual trigger) → On-demand testing
📋 Workflows
1. deploy.yml - Main Deployment Pipeline
Triggers:
- Push to
main→ Deploy to production - Push to
develop→ Deploy to development - Pull requests → Run quality checks only
Jobs:
-
quality-check - Runs on all pushes/PRs
- Type checking
- Linting
- Code formatting validation
-
test - Runs unit tests
- Unit tests (Vitest)
- Integration tests (future)
-
deploy-dev - Development deployment
- Trigger: Push to
develop - Target: Coolify dev environment
- Auto-deploy
- Trigger: Push to
-
deploy-prod - Production deployment
- Trigger: Push to
main - Target: Coolify production environment
- Auto-deploy
- Trigger: Push to
-
deploy-test - Test deployment (optional)
- Trigger: Manual (
workflow_dispatch) - Target: Coolify test environment
- Trigger: Manual (
2. pr-checks.yml - Pull Request Validation
Triggers:
- Pull requests to
mainordevelop
Jobs:
- Type checking
- Linting
- Tests
- Migration validation
- PR summary generation
🔐 Required Secrets
Configure these in Gitea Repository Settings → Secrets:
Coolify Webhook URLs
-
COOLIFY_WEBHOOK_DEV- Coolify webhook URL for dev environment
- Format:
https://coolify.jeanlucmakiola.de/api/v1/deploy/webhooks/{uuid}
-
COOLIFY_WEBHOOK_PROD- Coolify webhook URL for production environment
- Same format as above
-
COOLIFY_WEBHOOK_TEST(optional)- Coolify webhook URL for test environment
How to Get Webhook URLs
Via Coolify UI:
- Go to Coolify → Projects → Pantry
- Select environment (dev/prod/test)
- Click on the resource (application)
- Go to "Webhooks" or "Deploy" tab
- Copy webhook URL
Via Coolify API:
source ~/.openclaw/workspace/coolify-helpers.sh
COOLIFY_URL=$(grep COOLIFY_URL ~/.coolify-credentials | cut -d= -f2)
COOLIFY_TOKEN=$(grep COOLIFY_TOKEN ~/.coolify-credentials | cut -d= -f2)
# Get application UUID (once created)
curl -s -H "Authorization: Bearer $COOLIFY_TOKEN" \
"${COOLIFY_URL}/api/v1/applications" | jq '.[] | select(.name | contains("pantry"))'
# Webhook format:
# ${COOLIFY_URL}/api/v1/deploy/webhooks/{application_uuid}
🚀 Deployment Flow
Development Workflow
# 1. Create feature branch
git checkout -b feature/barcode-scanner
# 2. Make changes
# ... code ...
# 3. Commit and push
git add .
git commit -m "feat: Add barcode scanner component"
git push origin feature/barcode-scanner
# 4. Create PR to 'develop'
# → PR checks run automatically
# 5. Merge PR
# → Auto-deploys to dev environment
Production Release
# 1. Ensure develop is stable
git checkout develop
git pull
# 2. Create release PR to main
git checkout -b release/v0.1.0
# 3. Update version, changelog
# ... updates ...
# 4. Push and create PR to main
git push origin release/v0.1.0
# → PR checks run
# 5. Merge to main
# → Auto-deploys to production
🏗️ Coolify Setup (Per Environment)
Prerequisites
Each environment needs:
- Supabase service (already configured for dev)
- Pantry app resource (to be created)
Creating App Resource in Coolify
For each environment (dev/prod/test):
-
Go to Coolify → Projects → Pantry → [Environment]
-
Add New Resource:
- Type: Application
- Source: Git Repository
-
Configure Git:
- Repository:
https://gitea.jeanlucmakiola.de/pantry-app/pantry.git - Branch:
- Dev:
develop - Prod:
main - Test:
develop(or specific branch)
- Dev:
- Repository:
-
Build Configuration:
- Build Pack: Nixpacks or Dockerfile
- Dockerfile Path:
app/Dockerfile(when created) - Build Command:
bun install && bun run build - Start Command:
bun run start
-
Environment Variables:
- Import from
.env.developmentor.env.production - Link to Supabase service environment
- Import from
-
Domain:
- Dev:
pantry-dev.jeanlucmakiola.de - Prod:
pantry.jeanlucmakiola.de - Test:
pantry-test.jeanlucmakiola.de
- Dev:
-
Enable Webhook:
- Go to resource → Webhooks
- Copy webhook URL
- Add to Gitea secrets
🔍 Monitoring Deployments
Via Gitea
- Actions Tab in repository
- View workflow runs
- Check logs for each job
Via Coolify
- Resources → Select environment
- Deployments tab shows history
- Logs show build/runtime output
Manual Trigger (Emergency Deploy)
# Via Gitea Actions UI
# Repository → Actions → deploy.yml → Run workflow
# Or via webhook directly
curl -X POST "https://coolify.jeanlucmakiola.de/api/v1/deploy/webhooks/{uuid}"
🐛 Troubleshooting
Workflow Not Running
Check:
- Gitea Actions is enabled (repo settings)
.gitea/workflows/directory exists- YAML syntax is valid
Enable Gitea Actions:
# If self-hosted Gitea instance
# Check Gitea admin panel → Actions → Enabled
Deployment Failed
Check:
- Gitea Actions logs - See which step failed
- Coolify deployment logs - Build/runtime errors
- Environment variables - Missing/incorrect values
- Webhook URL - Correct and accessible
Secrets Not Working
Verify:
# In Gitea UI:
# Repository → Settings → Secrets → Actions
# Ensure COOLIFY_WEBHOOK_* secrets exist
📊 Workflow Status Badges
Add to README.md:
[](https://gitea.jeanlucmakiola.de/pantry-app/pantry/actions)
🔮 Future Improvements
v0.2+
- E2E tests in pipeline (Playwright)
- Database migration validation
- Performance benchmarks
- Lighthouse CI (PWA scores)
- Automatic changelog generation
- Slack/Discord notifications
v0.3+
- Staging environment
- Blue-green deployments
- Rollback automation
- Database backup before migrations
📚 References
- Gitea Actions Docs
- Coolify Webhooks
- GitHub Actions Syntax (compatible with Gitea)
Next Steps:
- Get Coolify webhook URLs for dev/prod
- Add secrets to Gitea repository
- Create Pantry app resources in Coolify
- Test deployment pipeline