Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
299fa1f403 | ||
|
|
d13ecbbdb9 |
+17
-54
@@ -1,79 +1,42 @@
|
||||
name: CI/CD Pipeline
|
||||
name: Build and Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master, main ]
|
||||
pull_request:
|
||||
branches: [ master, main ]
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
validate-and-build:
|
||||
name: Build & Validate
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install Frontend Dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run TypeScript & Lint Checks
|
||||
run: npm run lint
|
||||
|
||||
- name: Build Frontend Application
|
||||
run: npm run build
|
||||
|
||||
- name: Validate Backend
|
||||
run: |
|
||||
cd backend
|
||||
npm ci
|
||||
node --check server.js database.js mail.js
|
||||
|
||||
docker-build-and-push:
|
||||
name: Build & Push Docker Images
|
||||
runs-on: ubuntu-latest
|
||||
needs: validate-and-build
|
||||
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to Gitea Container Registry
|
||||
uses: docker/login-action@v3
|
||||
- name: Login to Gitea Container Registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: git.digifox.live
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITEA_TOKEN || secrets.GITHUB_TOKEN }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and Push Frontend Image
|
||||
uses: docker/build-push-action@v6
|
||||
- name: Build and push Web
|
||||
uses: docker/build-push-action@v4
|
||||
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
|
||||
- name: Build and push API
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: ./backend
|
||||
file: ./backend/Dockerfile
|
||||
push: true
|
||||
tags: git.digifox.live/digifoxkurama/titan-api:latest
|
||||
|
||||
- name: Trigger Coolify Zero-Downtime Redeploy
|
||||
- name: Trigger Coolify Deployment
|
||||
run: |
|
||||
curl -s -X POST \
|
||||
-H "Authorization: Bearer ${{ secrets.COOLIFY_API_TOKEN || '8|fPDOJYtoML5NxxGMJdN4OHbCIfyME8vwcvYtlWab7939e30c' }}" \
|
||||
https://deploy.digifox.live/api/v1/services/lbvulal59jsvjqi4rvfw8i4q/restart
|
||||
curl --request POST \
|
||||
--url 'https://deploy.digifox.live/api/v1/deploy?uuid=lbvulal59jsvjqi4rvfw8i4q' \
|
||||
--header 'Authorization: Bearer 4|lL3pgQVbfLb6KtUByDLaswjP4Jccny8HMj5jrs0v4ace4e78'
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
name: CI/CD Pipeline
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master, main ]
|
||||
pull_request:
|
||||
branches: [ master, main ]
|
||||
|
||||
jobs:
|
||||
validate-and-build:
|
||||
name: Build & Validate
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install Frontend Dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run TypeScript & Lint Checks
|
||||
run: npm run lint
|
||||
|
||||
- name: Build Frontend Application
|
||||
run: npm run build
|
||||
|
||||
- name: Validate Backend
|
||||
run: |
|
||||
cd backend
|
||||
npm ci
|
||||
node --check server.js database.js mail.js
|
||||
|
||||
docker-build-and-push:
|
||||
name: Build & Push Docker Images
|
||||
runs-on: ubuntu-latest
|
||||
needs: validate-and-build
|
||||
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to Gitea Container Registry
|
||||
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
|
||||
@@ -24,7 +24,6 @@ RUN npm run build
|
||||
FROM nginx:alpine AS production
|
||||
# Copy built assets from the build stage to Nginx
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
COPY --from=build /app/3dmodels /usr/share/nginx/html/3dmodels
|
||||
# Copy custom nginx config
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
# Expose port 80 for Nginx
|
||||
|
||||
@@ -1,21 +1,17 @@
|
||||
services:
|
||||
web:
|
||||
image: git.digifox.live/digifoxkurama/titan-web:latest
|
||||
restart: always
|
||||
build:
|
||||
context: .
|
||||
target: production
|
||||
expose:
|
||||
- "80"
|
||||
ports:
|
||||
- "3000:80"
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
labels:
|
||||
- "coolify.endpoint=true"
|
||||
|
||||
api:
|
||||
image: git.digifox.live/digifoxkurama/titan-api:latest
|
||||
restart: always
|
||||
build:
|
||||
context: ./backend
|
||||
|
||||
Binary file not shown.
+1
-2
@@ -8,8 +8,7 @@
|
||||
"build": "vite build",
|
||||
"preview": "vite preview",
|
||||
"clean": "rm -rf dist",
|
||||
"lint": "tsc --noEmit",
|
||||
"deploy": "bash scripts/deploy.sh"
|
||||
"lint": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fal-ai/client": "^1.10.1",
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
echo "🚀 [1/3] Building production Docker images..."
|
||||
docker compose build
|
||||
|
||||
echo "📦 [2/3] Pushing images to Gitea Container Registry..."
|
||||
docker push git.digifox.live/digifoxkurama/titan-web:latest
|
||||
docker push git.digifox.live/digifoxkurama/titan-api:latest
|
||||
|
||||
echo "🔄 [3/3] Triggering Coolify zero-downtime reload..."
|
||||
RESPONSE=$(curl -s -X POST \
|
||||
-H "Authorization: Bearer 8|fPDOJYtoML5NxxGMJdN4OHbCIfyME8vwcvYtlWab7939e30c" \
|
||||
https://deploy.digifox.live/api/v1/services/lbvulal59jsvjqi4rvfw8i4q/restart)
|
||||
|
||||
echo "✅ Deployed! Coolify status: $RESPONSE"
|
||||
echo "🌐 Live URL: https://titan.houseofwebsites.ai"
|
||||
Reference in New Issue
Block a user