fix(woodpecker): remove detect-changes step - always build
This commit is contained in:
parent
ff2c2291cf
commit
897518c86e
1 changed files with 0 additions and 42 deletions
|
|
@ -3,48 +3,6 @@ when:
|
||||||
event: push
|
event: push
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: detect-changes
|
|
||||||
image: alpine/git
|
|
||||||
commands:
|
|
||||||
- apk add --no-cache bash
|
|
||||||
- |
|
|
||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# Fetch previous commit for comparison
|
|
||||||
git fetch --depth=2 origin +refs/heads/${CI_COMMIT_BRANCH}:refs/remotes/origin/${CI_COMMIT_BRANCH} || true
|
|
||||||
|
|
||||||
# Get changed files (handle shallow clone)
|
|
||||||
CHANGED_FILES=$(git diff --name-only HEAD~1 HEAD 2>/dev/null || git diff --name-only origin/${CI_COMMIT_BRANCH}~1 origin/${CI_COMMIT_BRANCH} 2>/dev/null || echo "ALL")
|
|
||||||
|
|
||||||
# If we can't detect changes, assume we should build
|
|
||||||
if [ "$CHANGED_FILES" = "ALL" ] || [ -z "$CHANGED_FILES" ]; then
|
|
||||||
echo "⚠️ Cannot detect changes, assuming build needed"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Skip if only docs changed
|
|
||||||
if echo "$CHANGED_FILES" | grep -qE "^\.github/|^\.woodpecker|\.md$"; then
|
|
||||||
if ! echo "$CHANGED_FILES" | grep -qE "^(src/|package\.json|Dockerfile|vite\.config)"; then
|
|
||||||
echo "⏭️ Only docs changed, skipping"
|
|
||||||
exit 78
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
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"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$RELEVANT_CHANGED" = "true" ]; then
|
|
||||||
echo "🚀 Building admin panel"
|
|
||||||
exit 0
|
|
||||||
else
|
|
||||||
echo "⏭️ Skipping admin panel"
|
|
||||||
exit 78
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: build-and-push
|
- name: build-and-push
|
||||||
image: woodpeckerci/plugin-docker-buildx:5.0.0
|
image: woodpeckerci/plugin-docker-buildx:5.0.0
|
||||||
settings:
|
settings:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue