2026-04-09 00:09:03 +02:00
|
|
|
when:
|
2026-04-10 05:21:45 +02:00
|
|
|
branch: [main, high-performance]
|
2026-04-09 00:09:03 +02:00
|
|
|
event: push
|
|
|
|
|
|
|
|
|
|
steps:
|
2026-04-10 05:21:45 +02:00
|
|
|
- name: detect-changes
|
|
|
|
|
image: alpine/git
|
|
|
|
|
commands:
|
|
|
|
|
- apk add --no-cache bash
|
|
|
|
|
- |
|
|
|
|
|
#!/bin/bash
|
|
|
|
|
set -e
|
2026-04-10 05:34:57 +02:00
|
|
|
|
2026-04-10 05:21:45 +02:00
|
|
|
# Get changed files from last commit
|
|
|
|
|
CHANGED_FILES=$(git diff --name-only HEAD~1 HEAD || echo "")
|
2026-04-10 05:34:57 +02:00
|
|
|
|
2026-04-10 05:21:45 +02:00
|
|
|
# Check if relevant files changed (src, package.json, Dockerfile, etc.)
|
|
|
|
|
RELEVANT_CHANGED=false
|
|
|
|
|
if echo "$CHANGED_FILES" | grep -qE "^(src/|package\.json|package-lock\.json|Dockerfile|vite\.config|tsconfig|public/)"; then
|
|
|
|
|
RELEVANT_CHANGED=true
|
|
|
|
|
echo "✅ Admin panel code changed - will build"
|
|
|
|
|
fi
|
2026-04-10 05:34:57 +02:00
|
|
|
|
2026-04-10 05:27:39 +02:00
|
|
|
# Exit with code 78 to skip subsequent steps if no changes
|
2026-04-10 05:21:45 +02:00
|
|
|
if [ "$RELEVANT_CHANGED" = "true" ]; then
|
|
|
|
|
echo "🚀 Will build admin panel"
|
2026-04-10 05:27:39 +02:00
|
|
|
exit 0
|
2026-04-10 05:21:45 +02:00
|
|
|
else
|
|
|
|
|
echo "⏭️ Skipping admin panel - no relevant changes"
|
2026-04-10 05:27:39 +02:00
|
|
|
exit 78
|
2026-04-10 05:21:45 +02:00
|
|
|
fi
|
|
|
|
|
|
2026-04-09 00:09:03 +02:00
|
|
|
- name: build-and-push
|
2026-04-09 01:11:16 +02:00
|
|
|
image: woodpeckerci/plugin-docker-buildx:5.0.0
|
2026-04-09 00:09:03 +02:00
|
|
|
settings:
|
|
|
|
|
registry: ghcr.io
|
|
|
|
|
repo: ghcr.io/traceworks2023/nxtgauge-admin-solid
|
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
|
tags:
|
2026-04-10 05:21:45 +02:00
|
|
|
- ${CI_COMMIT_SHA}
|
|
|
|
|
- latest
|
2026-04-09 00:09:03 +02:00
|
|
|
- high-performance-latest
|
|
|
|
|
username:
|
|
|
|
|
from_secret: GHCR_USERNAME
|
|
|
|
|
password:
|
|
|
|
|
from_secret: GHCR_TOKEN
|
|
|
|
|
platforms: linux/amd64
|