Attemp to add ntfy for push notifications
All checks were successful
Build & Deploy Costco Grocery List / build (push) Successful in 16s
Build & Deploy Costco Grocery List / deploy (push) Successful in 7s

This commit is contained in:
Nico 2025-11-26 20:51:15 -08:00
parent f23e7db2c9
commit 69eacfaf77
2 changed files with 40 additions and 0 deletions

View File

@ -104,3 +104,28 @@ jobs:
docker compose up -d --remove-orphans
docker image prune -f
EOF
notify:
- name: Wait for ntfy service to be healthy
run: |
ssh -o StrictHostKeyChecking=no $SERVER_USER@$SERVER_IP '
echo "Waiting for ntfy container..."
for i in {1..30}; do
STATUS=$(docker inspect --format="{{json .State.Health.Status }}" ntfy)
if [[ $STATUS == "\"healthy\"" ]]; then
echo "ntfy is healthy!"
exit 0
fi
echo "ntfy not ready yet ($STATUS). Retrying..."
sleep 2
done
echo "Error: ntfy did not become healthy in time."
exit 1
'
- name: Notify ntfy
run: |
curl -d "🚀 Deployment successful: $IMAGE_NAME:$GITHUB_SHA" \
https://ntfy.nicosaya.com/server-deploy

View File

@ -18,3 +18,18 @@ services:
- "3000:5173"
depends_on:
- backend
services:
ntfy:
image: binwiederhier/ntfy
ports:
- 8081:80
volumes:
- ./ntfy/cache:/var/cache/ntfy
- ./ntfy/etc:/etc/ntfy
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost/"]
interval: 5s
timeout: 3s
retries: 10