Some checks failed
Deploy / Test (push) Failing after 1s
Deploy / Build App Image (push) Has been skipped
Deploy / Build Web Image (push) Has been skipped
Deploy / Build Core Image (push) Has been skipped
Deploy / Deploy to Production (push) Has been skipped
Security Scan / security (push) Successful in 16s
Replace inline docker build/push jobs with shared workflow from go-devops. Add proper multi-stage Dockerfile.core (was inline heredoc). Switch registry from dappco.re/osi to docker.io/lthn/. Requires org secrets: REGISTRY_USER, REGISTRY_TOKEN Co-Authored-By: Virgil <virgil@lethean.io>
80 lines
2 KiB
YAML
80 lines
2 KiB
YAML
# Host UK Production Deployment Pipeline
|
|
# Builds 3 Docker images via reusable workflow, then triggers Coolify deploy.
|
|
|
|
name: Deploy
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: "8.3"
|
|
extensions: bcmath, gd, intl, mbstring, pdo_mysql, redis, zip
|
|
coverage: none
|
|
|
|
- name: Install Composer dependencies
|
|
run: composer install --no-interaction --prefer-dist
|
|
|
|
- name: Run tests
|
|
run: composer test
|
|
|
|
- name: Check code style
|
|
run: ./vendor/bin/pint --test
|
|
|
|
build-app:
|
|
name: Build App Image
|
|
needs: test
|
|
uses: core/go-devops/.forgejo/workflows/docker-publish.yml@main
|
|
with:
|
|
image: lthn/app
|
|
dockerfile: docker/Dockerfile.app
|
|
registry: docker.io
|
|
secrets: inherit
|
|
|
|
build-web:
|
|
name: Build Web Image
|
|
needs: test
|
|
uses: core/go-devops/.forgejo/workflows/docker-publish.yml@main
|
|
with:
|
|
image: lthn/web
|
|
dockerfile: docker/Dockerfile.web
|
|
registry: docker.io
|
|
secrets: inherit
|
|
|
|
build-core:
|
|
name: Build Core Image
|
|
needs: test
|
|
uses: core/go-devops/.forgejo/workflows/docker-publish.yml@main
|
|
with:
|
|
image: lthn/core
|
|
dockerfile: docker/Dockerfile.core
|
|
registry: docker.io
|
|
secrets: inherit
|
|
|
|
deploy:
|
|
name: Deploy to Production
|
|
needs: [build-app, build-web, build-core]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Trigger Coolify deploy
|
|
run: |
|
|
curl -s -X POST \
|
|
-H "Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}" \
|
|
"${{ secrets.COOLIFY_URL }}/api/v1/deploy" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"uuid": "${{ secrets.COOLIFY_APP_UUID }}", "force": false}'
|
|
|
|
- name: Wait for deployment
|
|
run: |
|
|
echo "Deployment triggered. Coolify will perform rolling restart."
|
|
echo "Monitor at: ${{ secrets.COOLIFY_URL }}"
|