48 lines
1.3 KiB
YAML
48 lines
1.3 KiB
YAML
# .gitea/workflows/deploy.yml
|
|
name: Bun CI/CD
|
|
|
|
on:
|
|
push:
|
|
branches: [main, staging]
|
|
pull_request:
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: 📥 Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: 🛠️ Install Bun
|
|
uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version: latest # Or specify a version like "1.3.3"
|
|
|
|
- run: bun ci
|
|
- run: bun test
|
|
|
|
# Preview - handled automatically by Coolify!
|
|
# No action needed here
|
|
|
|
deploy-staging:
|
|
needs: test
|
|
if: github.ref == 'refs/heads/staging'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Trigger Coolify Staging Deploy
|
|
run: |
|
|
curl -X POST \
|
|
--header 'Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}' \
|
|
"${{ secrets.COOLIFY_URL }}/api/v1/deploy?uuid=${{ secrets.COOLIFY_STAGING_APP_UUID }}&force=true"
|
|
|
|
deploy-prod:
|
|
needs: test
|
|
if: github.ref == 'refs/heads/main'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Trigger Coolify Production Deploy
|
|
run: |
|
|
# Deploy using application UUID
|
|
curl -X POST \
|
|
--header 'Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}' \
|
|
"${{ secrets.COOLIFY_URL }}/api/v1/deploy?uuid=${{ secrets.COOLIFY_PROD_APP_UUID }}&force=true" |