update_stack.yml logs
All checks were successful
Portainer Stack Update / update_stack (push) Successful in 4s
All checks were successful
Portainer Stack Update / update_stack (push) Successful in 4s
This commit is contained in:
parent
b56b51ca82
commit
92d397d5c6
@ -19,23 +19,24 @@ jobs:
|
||||
run: |
|
||||
# Get only changed docker-compose.yml files in top-level folders
|
||||
CHANGED_COMPOSE_DIRS=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -E '^[^/]+/docker-compose\.yml$' | cut -d '/' -f1 | sort -u || true)
|
||||
echo "::notice CHANGED_COMPOSE_DIRS=$CHANGED_COMPOSE_DIRS" >> $GITHUB_ENV
|
||||
echo "::notice title=Changed Files::$CHANGED_COMPOSE_DIRS"
|
||||
echo "CHANGED_COMPOSE_DIRS=$CHANGED_COMPOSE_DIRS" >> $GITHUB_ENV
|
||||
|
||||
- name: Update relevant stacks in Portainer
|
||||
if: env.CHANGED_COMPOSE_DIRS != ''
|
||||
run: |
|
||||
echo "::notice Reading stack mapping..."
|
||||
echo "::notice title=Found Changed yml::Reading stack mapping"
|
||||
STACK_MAP=$(cat .stack-map.json)
|
||||
|
||||
for dir in $CHANGED_COMPOSE_DIRS; do
|
||||
echo "::notice Checking directory: $dir"
|
||||
echo "::notice title=Checking directory::$dir"
|
||||
STACK_ID=$(echo "$STACK_MAP" | jq -r --arg d "$dir" '.[$d]')
|
||||
|
||||
if [ "$STACK_ID" != "null" ]; then
|
||||
echo "::notice Updating Portainer stack $dir (ID: $STACK_ID)..."
|
||||
echo "::notice title=Updating Portainer stack::$dir (ID: $STACK_ID)..."
|
||||
curl -X POST "http://portainer.szabolcsi.dev/api/stacks/webhooks/$STACK_ID"
|
||||
else
|
||||
echo "::notice No stack ID found for $dir, skipping."
|
||||
echo "::notice title=No stack ID found for::$dir, skipping."
|
||||
fi
|
||||
done
|
||||
env:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user