add notice to update_stack.yml
All checks were successful
Portainer Stack Update / update_stack (push) Successful in 3s
All checks were successful
Portainer Stack Update / update_stack (push) Successful in 3s
This commit is contained in:
parent
45e9cf269c
commit
5b22eaf9db
@ -19,24 +19,23 @@ 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 "CHANGED_COMPOSE_DIRS=$CHANGED_COMPOSE_DIRS" >> $GITHUB_ENV
|
||||
echo "::notice CHANGED_COMPOSE_DIRS=$CHANGED_COMPOSE_DIRS" >> $GITHUB_ENV
|
||||
|
||||
- name: Update relevant stacks in Portainer
|
||||
if: env.CHANGED_COMPOSE_DIRS != ''
|
||||
run: |
|
||||
echo "Van változás, frissítünk!"
|
||||
echo "Reading stack mapping..."
|
||||
echo "::notice Reading stack mapping..."
|
||||
STACK_MAP=$(cat .stack-map.json)
|
||||
|
||||
for dir in $CHANGED_COMPOSE_DIRS; do
|
||||
echo "Checking directory: $dir"
|
||||
echo "::notice Checking directory: $dir"
|
||||
STACK_ID=$(echo "$STACK_MAP" | jq -r --arg d "$dir" '.[$d]')
|
||||
|
||||
if [ "$STACK_ID" != "null" ]; then
|
||||
echo "Updating Portainer stack $dir (ID: $STACK_ID)..."
|
||||
echo "::notice Updating Portainer stack $dir (ID: $STACK_ID)..."
|
||||
curl -X POST "http://portainer.szabolcsi.dev/api/stacks/webhooks/$STACK_ID"
|
||||
else
|
||||
echo "No stack ID found for $dir, skipping."
|
||||
echo "::notice No stack ID found for $dir, skipping."
|
||||
fi
|
||||
done
|
||||
env:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user