ci: Add Gitea Actions workflows and CI/CD documentation
Some checks failed
Deploy to Coolify / Code Quality (push) Has been cancelled
Deploy to Coolify / Run Tests (push) Has been cancelled
Deploy to Coolify / Deploy to Development (push) Has been cancelled
Deploy to Coolify / Deploy to Production (push) Has been cancelled
Deploy to Coolify / Deploy to Test (push) Has been cancelled
Some checks failed
Deploy to Coolify / Code Quality (push) Has been cancelled
Deploy to Coolify / Run Tests (push) Has been cancelled
Deploy to Coolify / Deploy to Development (push) Has been cancelled
Deploy to Coolify / Deploy to Production (push) Has been cancelled
Deploy to Coolify / Deploy to Test (push) Has been cancelled
This commit is contained in:
136
.gitea/workflows/deploy.yml
Normal file
136
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,136 @@
|
||||
name: Deploy to Coolify
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main # Production deployment
|
||||
- develop # Development deployment
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- develop
|
||||
|
||||
jobs:
|
||||
# Lint and type-check (runs on all pushes and PRs)
|
||||
quality-check:
|
||||
name: Code Quality
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v1
|
||||
with:
|
||||
bun-version: latest
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
if [ -d "app" ]; then
|
||||
cd app
|
||||
bun install --frozen-lockfile
|
||||
else
|
||||
echo "App directory not yet created, skipping"
|
||||
fi
|
||||
|
||||
- name: Type check
|
||||
run: |
|
||||
if [ -d "app" ]; then
|
||||
cd app
|
||||
bun run typecheck || echo "Typecheck not configured yet"
|
||||
fi
|
||||
|
||||
- name: Lint
|
||||
run: |
|
||||
if [ -d "app" ]; then
|
||||
cd app
|
||||
bun run lint || echo "Linting not configured yet"
|
||||
fi
|
||||
|
||||
# Run tests (when implemented)
|
||||
test:
|
||||
name: Run Tests
|
||||
runs-on: ubuntu-latest
|
||||
needs: quality-check
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v1
|
||||
with:
|
||||
bun-version: latest
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
if [ -d "app" ]; then
|
||||
cd app
|
||||
bun install --frozen-lockfile
|
||||
fi
|
||||
|
||||
- name: Run unit tests
|
||||
run: |
|
||||
if [ -d "app" ]; then
|
||||
cd app
|
||||
bun test || echo "Tests not configured yet"
|
||||
fi
|
||||
|
||||
# Deploy to Development (develop branch only)
|
||||
deploy-dev:
|
||||
name: Deploy to Development
|
||||
runs-on: ubuntu-latest
|
||||
needs: [quality-check, test]
|
||||
if: github.ref == 'refs/heads/develop' && github.event_name == 'push'
|
||||
environment:
|
||||
name: development
|
||||
url: https://pantry-dev.jeanlucmakiola.de # Update with actual URL
|
||||
steps:
|
||||
- name: Trigger Coolify Deployment (Dev)
|
||||
run: |
|
||||
curl -X POST "${{ secrets.COOLIFY_WEBHOOK_DEV }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"branch": "develop"}'
|
||||
|
||||
- name: Deployment Status
|
||||
run: |
|
||||
echo "✅ Deployment triggered for development environment"
|
||||
echo "🔗 Check status: https://coolify.jeanlucmakiola.de"
|
||||
|
||||
# Deploy to Production (main branch only)
|
||||
deploy-prod:
|
||||
name: Deploy to Production
|
||||
runs-on: ubuntu-latest
|
||||
needs: [quality-check, test]
|
||||
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
||||
environment:
|
||||
name: production
|
||||
url: https://pantry.jeanlucmakiola.de # Update with actual URL
|
||||
steps:
|
||||
- name: Trigger Coolify Deployment (Prod)
|
||||
run: |
|
||||
curl -X POST "${{ secrets.COOLIFY_WEBHOOK_PROD }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"branch": "main"}'
|
||||
|
||||
- name: Deployment Status
|
||||
run: |
|
||||
echo "✅ Deployment triggered for production environment"
|
||||
echo "🔗 Check status: https://coolify.jeanlucmakiola.de"
|
||||
|
||||
# Optional: Deploy to Test (manual trigger)
|
||||
deploy-test:
|
||||
name: Deploy to Test
|
||||
runs-on: ubuntu-latest
|
||||
needs: [quality-check, test]
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
environment:
|
||||
name: test
|
||||
steps:
|
||||
- name: Trigger Coolify Deployment (Test)
|
||||
run: |
|
||||
curl -X POST "${{ secrets.COOLIFY_WEBHOOK_TEST }}" \
|
||||
-H "Content-Type: application/json"
|
||||
|
||||
- name: Deployment Status
|
||||
run: |
|
||||
echo "✅ Deployment triggered for test environment"
|
||||
65
.gitea/workflows/pr-checks.yml
Normal file
65
.gitea/workflows/pr-checks.yml
Normal file
@@ -0,0 +1,65 @@
|
||||
name: Pull Request Checks
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- develop
|
||||
|
||||
jobs:
|
||||
pr-validation:
|
||||
name: Validate PR
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # Full history for better diff analysis
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v1
|
||||
with:
|
||||
bun-version: latest
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
if [ -d "app" ]; then
|
||||
cd app
|
||||
bun install --frozen-lockfile
|
||||
fi
|
||||
|
||||
- name: Type check
|
||||
run: |
|
||||
if [ -d "app" ]; then
|
||||
cd app
|
||||
bun run typecheck || echo "⚠️ Typecheck not configured"
|
||||
fi
|
||||
|
||||
- name: Lint
|
||||
run: |
|
||||
if [ -d "app" ]; then
|
||||
cd app
|
||||
bun run lint || echo "⚠️ Linting not configured"
|
||||
fi
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
if [ -d "app" ]; then
|
||||
cd app
|
||||
bun test || echo "⚠️ Tests not configured"
|
||||
fi
|
||||
|
||||
- name: Check migrations
|
||||
run: |
|
||||
if [ -d "supabase/migrations" ]; then
|
||||
echo "📋 Migration files found:"
|
||||
ls -la supabase/migrations/
|
||||
fi
|
||||
|
||||
- name: PR Summary
|
||||
run: |
|
||||
echo "## ✅ Pull Request Validation Complete" >> $GITHUB_STEP_SUMMARY
|
||||
echo "" >> $GITHUB_STEP_SUMMARY
|
||||
echo "**Branch:** ${{ github.head_ref }}" >> $GITHUB_STEP_SUMMARY
|
||||
echo "**Target:** ${{ github.base_ref }}" >> $GITHUB_STEP_SUMMARY
|
||||
echo "**Author:** ${{ github.actor }}" >> $GITHUB_STEP_SUMMARY
|
||||
Reference in New Issue
Block a user