Simple notifications with ntfy

Getting notifications when stuff is done is quite easy with ntfy. It is simple and nifty!

Profile pictureToni Petrina
Published on 2024-01-191 min read
  • #events
  • #notifications

In day to day operations, various systems will process things asynchronously. The most common thing notification is "build complete" (or "build failed"). To get all the notifications from these systems into one, central location, I used ntfy - it's simple and convenient.

First, a topic is needed. Best naming scheme is "mycooltopic_ID" e.g. "project_5d6gd".

Then, curl -d "Thing happened" will send the notification into that topic.

I get notifications on both my phone and desktop - which is convenient for both build notifications as well as rare events notifications.

GHA integration

A handful snippet to paste into any GHA workflow:

  runs-on: ubuntu-latest
  needs: [build]
  if: success()

    - name: Notify on success
      run: curl -d "App deployed 🥳"

  runs-on: ubuntu-latest
  needs: [build]
  if: failure()

    - name: Notify on failure
      run: curl -d "App failed to deploy 😭"

Change code theme: