forked from BLC/sgeUpdated
main #1
@@ -1,10 +1,11 @@
|
|||||||
|
# .gitea/workflows/sgeupdated.yml
|
||||||
name: sgeUpdated CI/CD
|
name: sgeUpdated CI/CD
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main # Trigger when code is pushed/merged into main
|
- main # trigger only when code is merged into main
|
||||||
workflow_dispatch: # Allow manual trigger
|
workflow_dispatch: # allow manual trigger
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: sgeupdated-deploy-${{ github.ref }}
|
group: sgeupdated-deploy-${{ github.ref }}
|
||||||
@@ -13,18 +14,11 @@ concurrency:
|
|||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
# We no longer need fetch-depth: 2
|
|
||||||
|
|
||||||
#
|
- name: Deploy over SSH
|
||||||
# The "Detect changed files" step has been REMOVED
|
|
||||||
#
|
|
||||||
|
|
||||||
- name: Deploy Backend
|
|
||||||
# The 'if:' condition has been REMOVED
|
|
||||||
uses: appleboy/ssh-action@v1.0.3
|
uses: appleboy/ssh-action@v1.0.3
|
||||||
with:
|
with:
|
||||||
host: ${{ secrets.SERVER_HOST }}
|
host: ${{ secrets.SERVER_HOST }}
|
||||||
@@ -34,43 +28,22 @@ jobs:
|
|||||||
script: |
|
script: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
echo "🚀 Starting backend deployment..."
|
|
||||||
cd /home/ubuntu/Bgreen/sgeUpdated
|
cd /home/ubuntu/Bgreen/sgeUpdated
|
||||||
git fetch origin main
|
git fetch origin main
|
||||||
git reset --hard origin/main
|
git reset --hard origin/main
|
||||||
|
|
||||||
echo "⚙️ Rebuilding Backend..."
|
echo "⚡ Rebuilding Backend..."
|
||||||
cd sgeUpdated/sge-backend
|
cd sgeUpdated/sge-backend
|
||||||
/opt/apache-maven-3.9.11/bin/mvn clean install -DskipTests
|
/opt/apache-maven-3.9.11/bin/mvn clean install -DskipTests
|
||||||
cd ../..
|
cd ../..
|
||||||
docker compose up -d --build bgreen-backend
|
docker compose up -d --build bgreen-backend
|
||||||
|
|
||||||
echo "✅ Backend deployment complete!"
|
echo "⚡ Rebuilding Frontend..."
|
||||||
docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'
|
|
||||||
|
|
||||||
- name: Deploy Frontend
|
|
||||||
# The 'if:' condition has been REMOVED
|
|
||||||
uses: appleboy/ssh-action@v1.0.3
|
|
||||||
with:
|
|
||||||
host: ${{ secrets.SERVER_HOST }}
|
|
||||||
username: ${{ secrets.SERVER_USER }}
|
|
||||||
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
||||||
script_stop: true
|
|
||||||
script: |
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
echo "🚀 Starting frontend deployment..."
|
|
||||||
cd /home/ubuntu/Bgreen/sgeUpdated
|
|
||||||
git fetch origin main
|
|
||||||
git reset --hard origin/main
|
|
||||||
|
|
||||||
echo "⚙️ Rebuildingg Frontend..."
|
|
||||||
cd sgeUpdated/sge-frontend
|
cd sgeUpdated/sge-frontend
|
||||||
# Uncomment below if needed:
|
# npm install
|
||||||
# npm ci
|
|
||||||
# npm run build
|
# npm run build
|
||||||
cd ../..
|
cd ../..
|
||||||
docker compose up -d --build bgreen-frontend
|
docker compose up -d --build bgreen-frontend
|
||||||
|
|
||||||
echo "✅ Frontend deployment complete!"
|
echo "✅ Deployment complete. Current containers:"
|
||||||
docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'
|
docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'
|
||||||
Reference in New Issue
Block a user