CI/CD Integration
Recommended: Coolify Webhooks
Section titled “Recommended: Coolify Webhooks”The simplest CI/CD approach is to use Coolify’s built-in webhooks. When you provision with coolify:provision, a webhook is automatically configured.
- Go to your GitHub repository settings
- Add the webhook URL shown in the Coolify dashboard
- Enable “Auto Deploy” in Coolify application settings
Coolify handles deployments automatically on push - no GitHub Actions required.
GitHub Actions (Optional)
Section titled “GitHub Actions (Optional)”If you need to run tests or other steps before deploying, use the --uuid option:
name: Deploy
on: push: branches: [main]
jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: php-version: '8.4' - run: composer install - run: php artisan test
deploy: needs: test runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: php-version: '8.4' - run: composer install --no-dev - name: Deploy to Coolify env: COOLIFY_URL: ${{ secrets.COOLIFY_URL }} COOLIFY_TOKEN: ${{ secrets.COOLIFY_TOKEN }} run: php artisan coolify:deploy --uuid=${{ secrets.COOLIFY_APP_UUID }} --force --waitRequired Secrets
Section titled “Required Secrets”Add to GitHub repository settings:
COOLIFY_URL- Your Coolify instance URLCOOLIFY_TOKEN- API tokenCOOLIFY_APP_UUID- Application UUID (shown after provisioning)
Deployment Strategies
Section titled “Deployment Strategies”Manual Trigger
Section titled “Manual Trigger”on: workflow_dispatch:Tag-Based Releases
Section titled “Tag-Based Releases”on: push: tags: - 'v*'
jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: php-version: '8.4' - run: composer install --no-dev - name: Deploy tag env: COOLIFY_URL: ${{ secrets.COOLIFY_URL }} COOLIFY_TOKEN: ${{ secrets.COOLIFY_TOKEN }} run: php artisan coolify:deploy --uuid=${{ secrets.COOLIFY_APP_UUID }} --tag=${{ github.ref_name }} --forceStatus Checks
Section titled “Status Checks”Wait for deployment and fail workflow on deployment failure:
- name: Deploy and verify run: | php artisan coolify:deploy --uuid=${{ secrets.COOLIFY_APP_UUID }} --force --wait # Exit code reflects deployment status