fix: deploy from checkout dir instead of /workspace/nexus
CI - Build & Test / Backend (.NET) (push) Successful in 29s
CI - Build & Test / Frontend (Vue/TS) (push) Successful in 16s
CI - Build & Test / Security Check (push) Successful in 3s

The runner job container does not have /workspace/nexus mounted.
Run everything from the checkout directory which has .git and compose.yaml.
- Removed rsync sync step (not needed)
- Version bump uses checkout dir with full git history
- Docker compose runs from checkout dir
- Added fetch-depth:0 and fetch-tags for version tagging
This commit is contained in:
2026-06-09 20:30:31 +02:00
parent 247dddc2fc
commit 3e0db0dfd1
+10 -35
View File
@@ -31,61 +31,37 @@ on:
jobs:
deploy:
name: Deploy Nexus
runs-on: deploy # only on runners with 'deploy' label
runs-on: deploy
if: ${{ gitea.event_name != 'workflow_run' || gitea.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout latest code
uses: actions/checkout@v3
- name: Install rsync
run: apt-get update -qq && apt-get install -y -qq rsync
- name: Sync to deploy path
run: |
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/
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Version Bump
working-directory: /workspace/nexus
run: |
# Read current version
CURRENT_VERSION=$(cat VERSION)
echo "📦 Current version: $CURRENT_VERSION"
# Parse major.minor.patch
MAJOR=$(echo $CURRENT_VERSION | cut -d. -f1)
MINOR=$(echo $CURRENT_VERSION | cut -d. -f2)
PATCH=$(echo $CURRENT_VERSION | cut -d. -f3)
# Bump according to input
case "${{ inputs.bump_version }}" in
major)
MAJOR=$((MAJOR + 1))
MINOR=0
PATCH=0
;;
MAJOR=$((MAJOR + 1)); MINOR=0; PATCH=0 ;;
minor)
MINOR=$((MINOR + 1))
PATCH=0
;;
MINOR=$((MINOR + 1)); PATCH=0 ;;
patch|*)
PATCH=$((PATCH + 1))
;;
PATCH=$((PATCH + 1)) ;;
esac
NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}"
echo "🏷️ New version: $NEW_VERSION"
echo "$NEW_VERSION" > VERSION
# Commit & push version bump
git config user.email "devops@noveria.net"
git config user.name "DevOps"
git add VERSION
@@ -98,7 +74,6 @@ jobs:
run: docker buildx create --use 2>/dev/null || true
- name: Build & Deploy
working-directory: /workspace/nexus
run: |
BUILD_ARGS=""
if [ "${{ inputs.no_cache }}" = "true" ]; then
@@ -119,9 +94,9 @@ jobs:
run: |
sleep 5
echo "🏥 Health check..."
curl -sf --max-time 10 https://nexus.noveria.net/health || echo "⚠️ Health check failed"
curl -sf --max-time 30 --retry 3 --retry-delay 5 https://nexus.noveria.net/health || echo "⚠️ Health check failed (may need more time)"
echo ""
docker compose -f /workspace/nexus/compose.yaml ps
docker compose ps
- name: Verify (smoke test)
run: |