Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f25c5974c4 | |||
| c13d730aa0 | |||
| 399e0c8846 | |||
| b41992ec0a | |||
| 2ab198baa7 | |||
| 3e0db0dfd1 | |||
| 247dddc2fc | |||
| c01c6c990e |
@@ -2,6 +2,10 @@ name: Deploy to Production
|
|||||||
run-name: 🚀 Deploy ${{ inputs.bump_version || 'patch' }} by @${{ gitea.actor }}
|
run-name: 🚀 Deploy ${{ inputs.bump_version || 'patch' }} by @${{ gitea.actor }}
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_run:
|
||||||
|
workflows: ["CI - Build & Test"]
|
||||||
|
types: [completed]
|
||||||
|
branches: [main]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
bump_version:
|
bump_version:
|
||||||
@@ -27,57 +31,37 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
name: Deploy Nexus
|
name: Deploy Nexus
|
||||||
runs-on: deploy # only on runners with 'deploy' label
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ gitea.event_name != 'workflow_run' || gitea.event.workflow_run.conclusion == 'success' }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout latest code
|
- name: Checkout latest code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
- name: Sync to deploy path
|
fetch-depth: 0
|
||||||
run: |
|
fetch-tags: true
|
||||||
rsync -a --delete \
|
|
||||||
--exclude='.git' \
|
|
||||||
--exclude='.env' \
|
|
||||||
--exclude='backend-tests/bin' \
|
|
||||||
--exclude='backend-tests/obj' \
|
|
||||||
--exclude='backend/bin' \
|
|
||||||
--exclude='backend/obj' \
|
|
||||||
--exclude='frontend/dist' \
|
|
||||||
--exclude='frontend/node_modules' \
|
|
||||||
${{ gitea.workspace }}/ /workspace/nexus/
|
|
||||||
|
|
||||||
- name: Version Bump
|
- name: Version Bump
|
||||||
working-directory: /workspace/nexus
|
|
||||||
run: |
|
run: |
|
||||||
# Read current version
|
|
||||||
CURRENT_VERSION=$(cat VERSION)
|
CURRENT_VERSION=$(cat VERSION)
|
||||||
echo "📦 Current version: $CURRENT_VERSION"
|
echo "📦 Current version: $CURRENT_VERSION"
|
||||||
|
|
||||||
# Parse major.minor.patch
|
|
||||||
MAJOR=$(echo $CURRENT_VERSION | cut -d. -f1)
|
MAJOR=$(echo $CURRENT_VERSION | cut -d. -f1)
|
||||||
MINOR=$(echo $CURRENT_VERSION | cut -d. -f2)
|
MINOR=$(echo $CURRENT_VERSION | cut -d. -f2)
|
||||||
PATCH=$(echo $CURRENT_VERSION | cut -d. -f3)
|
PATCH=$(echo $CURRENT_VERSION | cut -d. -f3)
|
||||||
|
|
||||||
# Bump according to input
|
|
||||||
case "${{ inputs.bump_version }}" in
|
case "${{ inputs.bump_version }}" in
|
||||||
major)
|
major)
|
||||||
MAJOR=$((MAJOR + 1))
|
MAJOR=$((MAJOR + 1)); MINOR=0; PATCH=0 ;;
|
||||||
MINOR=0
|
|
||||||
PATCH=0
|
|
||||||
;;
|
|
||||||
minor)
|
minor)
|
||||||
MINOR=$((MINOR + 1))
|
MINOR=$((MINOR + 1)); PATCH=0 ;;
|
||||||
PATCH=0
|
|
||||||
;;
|
|
||||||
patch|*)
|
patch|*)
|
||||||
PATCH=$((PATCH + 1))
|
PATCH=$((PATCH + 1)) ;;
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}"
|
NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}"
|
||||||
echo "🏷️ New version: $NEW_VERSION"
|
echo "🏷️ New version: $NEW_VERSION"
|
||||||
echo "$NEW_VERSION" > VERSION
|
echo "$NEW_VERSION" > VERSION
|
||||||
|
|
||||||
# Commit & push version bump
|
|
||||||
git config user.email "devops@noveria.net"
|
git config user.email "devops@noveria.net"
|
||||||
git config user.name "DevOps"
|
git config user.name "DevOps"
|
||||||
git add VERSION
|
git add VERSION
|
||||||
@@ -86,34 +70,61 @@ jobs:
|
|||||||
git push "https://devops:${{ secrets.GIT_TOKEN }}@git.noveria.net/bao/nexus.git" HEAD:main --tags
|
git push "https://devops:${{ secrets.GIT_TOKEN }}@git.noveria.net/bao/nexus.git" HEAD:main --tags
|
||||||
echo "✅ Version bumped to v${NEW_VERSION}"
|
echo "✅ Version bumped to v${NEW_VERSION}"
|
||||||
|
|
||||||
|
- name: Sync code to host deploy path
|
||||||
|
run: |
|
||||||
|
docker run --rm \
|
||||||
|
-v "${{ gitea.workspace }}:/src:ro" \
|
||||||
|
-v /opt/openclaw/data/openclaw/workspace/nexus:/dest \
|
||||||
|
alpine:latest \
|
||||||
|
sh -c "
|
||||||
|
cd /src && \
|
||||||
|
find . -mindepth 1 -maxdepth 1 \
|
||||||
|
! -name .git \
|
||||||
|
! -name .env \
|
||||||
|
-exec cp -a {} /dest/ \;
|
||||||
|
"
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
run: docker buildx create --use 2>/dev/null || true
|
run: docker buildx create --use 2>/dev/null || true
|
||||||
|
|
||||||
- name: Build & Deploy
|
- name: Build & Deploy
|
||||||
working-directory: /workspace/nexus
|
|
||||||
run: |
|
run: |
|
||||||
BUILD_ARGS=""
|
BUILD_ARGS=""
|
||||||
if [ "${{ inputs.no_cache }}" = "true" ]; then
|
if [ "${{ inputs.no_cache }}" = "true" ]; then
|
||||||
BUILD_ARGS="--no-cache"
|
BUILD_ARGS="--no-cache"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${{ inputs.service }}" ]; then
|
docker run --rm \
|
||||||
echo "🚀 Deploying service: ${{ inputs.service }}"
|
-v /opt/openclaw/data/openclaw/workspace/nexus:/workspace/nexus \
|
||||||
docker compose build $BUILD_ARGS ${{ inputs.service }}
|
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||||
docker compose up -d --force-recreate ${{ inputs.service }}
|
-w /workspace/nexus \
|
||||||
|
docker:cli \
|
||||||
|
sh -c "
|
||||||
|
set -e
|
||||||
|
if [ -n '${{ inputs.service }}' ]; then
|
||||||
|
echo '🚀 Deploying service: ${{ inputs.service }}'
|
||||||
|
docker compose build $BUILD_ARGS \${{ inputs.service }}
|
||||||
|
docker compose up -d --force-recreate \${{ inputs.service }}
|
||||||
else
|
else
|
||||||
echo "🚀 Deploying all services"
|
echo '🚀 Deploying all services'
|
||||||
docker compose build $BUILD_ARGS
|
docker compose build $BUILD_ARGS
|
||||||
docker compose up -d --force-recreate
|
docker compose up -d --force-recreate
|
||||||
fi
|
fi
|
||||||
|
"
|
||||||
|
|
||||||
- name: Health Check
|
- name: Health Check
|
||||||
run: |
|
run: |
|
||||||
sleep 5
|
sleep 5
|
||||||
echo "🏥 Health check..."
|
echo "🏥 Health check..."
|
||||||
curl -sf --max-time 10 https://nexus.noveria.net/health || echo "⚠️ Health check failed"
|
for i in 1 2 3 4 5 6; do
|
||||||
|
if curl -sf --max-time 10 https://nexus.noveria.net/health; then
|
||||||
echo ""
|
echo ""
|
||||||
docker compose -f /workspace/nexus/compose.yaml ps
|
echo "✅ Health check passed"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
echo "⏳ Retry $i/6..."
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
|
|
||||||
- name: Verify (smoke test)
|
- name: Verify (smoke test)
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
Nexus is the operations platform for the Noveria ecosystem. OpenClaw is an
|
Nexus is the operations platform for the Noveria ecosystem. OpenClaw is an
|
||||||
adapter-backed agent runtime, not a dependency of the frontend or domain model.
|
adapter-backed agent runtime, not a dependency of the frontend or domain model.
|
||||||
|
|
||||||
|
> CI/CD auto-deploy enabled — every push to main triggers build → test → deploy.
|
||||||
|
|
||||||
## Current foundation
|
## Current foundation
|
||||||
|
|
||||||
- Vue 3, TypeScript, Pinia, Vue Router and Tailwind CSS
|
- Vue 3, TypeScript, Pinia, Vue Router and Tailwind CSS
|
||||||
|
|||||||
Reference in New Issue
Block a user