ci: add automated docker build, push, and Coolify redeploy steps
This commit is contained in:
@@ -36,10 +36,11 @@ jobs:
|
|||||||
npm ci
|
npm ci
|
||||||
node --check server.js database.js mail.js
|
node --check server.js database.js mail.js
|
||||||
|
|
||||||
docker-build:
|
docker-build-and-push:
|
||||||
name: Docker Build Validation
|
name: Build & Push Docker Images
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: validate-and-build
|
needs: validate-and-build
|
||||||
|
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
@@ -48,5 +49,31 @@ jobs:
|
|||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Build Docker Compose Stack
|
- name: Log in to Gitea Container Registry
|
||||||
run: docker compose build
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: git.digifox.live
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITEA_TOKEN || secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and Push Frontend Image
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: git.digifox.live/digifoxkurama/titan-web:latest
|
||||||
|
|
||||||
|
- name: Build and Push Backend Image
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: ./backend
|
||||||
|
file: ./backend/Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: git.digifox.live/digifoxkurama/titan-api:latest
|
||||||
|
|
||||||
|
- name: Trigger Coolify Zero-Downtime Redeploy
|
||||||
|
run: |
|
||||||
|
curl -s -X POST \
|
||||||
|
-H "Authorization: Bearer ${{ secrets.COOLIFY_API_TOKEN || '8|fPDOJYtoML5NxxGMJdN4OHbCIfyME8vwcvYtlWab7939e30c' }}" \
|
||||||
|
https://deploy.digifox.live/api/v1/services/lbvulal59jsvjqi4rvfw8i4q/restart
|
||||||
|
|||||||
@@ -36,10 +36,11 @@ jobs:
|
|||||||
npm ci
|
npm ci
|
||||||
node --check server.js database.js mail.js
|
node --check server.js database.js mail.js
|
||||||
|
|
||||||
docker-build:
|
docker-build-and-push:
|
||||||
name: Docker Build Validation
|
name: Build & Push Docker Images
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: validate-and-build
|
needs: validate-and-build
|
||||||
|
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
@@ -48,5 +49,31 @@ jobs:
|
|||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Build Docker Compose Stack
|
- name: Log in to Gitea Container Registry
|
||||||
run: docker compose build
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: git.digifox.live
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITEA_TOKEN || secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and Push Frontend Image
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: git.digifox.live/digifoxkurama/titan-web:latest
|
||||||
|
|
||||||
|
- name: Build and Push Backend Image
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: ./backend
|
||||||
|
file: ./backend/Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: git.digifox.live/digifoxkurama/titan-api:latest
|
||||||
|
|
||||||
|
- name: Trigger Coolify Zero-Downtime Redeploy
|
||||||
|
run: |
|
||||||
|
curl -s -X POST \
|
||||||
|
-H "Authorization: Bearer ${{ secrets.COOLIFY_API_TOKEN || '8|fPDOJYtoML5NxxGMJdN4OHbCIfyME8vwcvYtlWab7939e30c' }}" \
|
||||||
|
https://deploy.digifox.live/api/v1/services/lbvulal59jsvjqi4rvfw8i4q/restart
|
||||||
|
|||||||
Reference in New Issue
Block a user