IFTTT Notifications
CreatedApr 4, 2026Takeshi Takatsudo
Deploy status notifications via IFTTT webhooks
Overview
Send mobile push notifications on deploy success/failure using IFTTT webhooks.
Setup
- Create an IFTTT applet with the Webhooks trigger
- Set the event name (e.g.,
deploy_notify) - Connect to the Notifications action
- Copy the webhook URL and store it as
IFTTT_PROD_NOTIFYin GitHub repo secrets
Notification Job
Add as the final job that runs if: always():
notify:
name: Deploy Notification
needs: [build-site, deploy]
if: always()
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Notify via IFTTT
if: env.IFTTT_PROD_NOTIFY != ''
env:
IFTTT_PROD_NOTIFY: ${{ secrets.IFTTT_PROD_NOTIFY }}
RAW_COMMIT_MSG: ${{ github.event.head_commit.message }}
BUILD_RESULT: ${{ needs.build-site.result }}
DEPLOY_RESULT: ${{ needs.deploy.result }}
run: |
if [ "$DEPLOY_RESULT" = "success" ]; then
STATUS="my-site deploy succeeded!"
elif [ "$BUILD_RESULT" = "failure" ]; then
STATUS="my-site deploy failed (build)"
elif [ "$DEPLOY_RESULT" = "failure" ]; then
STATUS="my-site deploy failed (deploy)"
else
STATUS="my-site deploy cancelled"
fi
COMMIT_MSG=$(echo "$RAW_COMMIT_MSG" | head -1 | sed 's/"/\\"/g')
SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
curl -sSf --max-time 10 -X POST "$IFTTT_PROD_NOTIFY" \
-H 'Content-Type: application/json' \
-d "{
\"value1\": \"${STATUS}\",
\"value2\": \"${SHORT_SHA} ${COMMIT_MSG}\",
\"value3\": \"${RUN_URL}\"
}" || echo "::warning::IFTTT notification failed"
Key Details
if: always(): The notification job runs regardless of whether previous jobs succeeded or failedif: env.IFTTT_PROD_NOTIFY != '': The step is skipped if the secret is not set (useful for forks)--max-time 10: Timeout the curl request to avoid hanging the workflow|| echo "::warning::": Log a warning instead of failing the job if IFTTT is unreachable- Three values: IFTTT webhooks support
value1,value2,value3— used for status, commit info, and run URL