2.0 KiB
2.0 KiB
tags
| tags | |||
|---|---|---|---|
|
Here is how to add instant notifications to your setup and solve the common homelab issue of mismatched storage paths between your testing runner and your live production server.
🔔 Part 1: Send a Discord or Telegram Notification
You can easily append a notification step to the very end of your workflow. By utilizing Gitea's conditional blocks (if: always()), you can ensure you get notified whether the deployment succeeds or crashes.
Option A: Sending to Discord
-
Open your Discord server, go to your target channel settings, click Integrations, and create a Webhook. Copy the URL.
-
Store that URL in your Gitea Repository Secrets as
DISCORD_WEBHOOK.- name: Send Discord Status Notification if: always() # Ensures this runs even if the deployment failed uses: https://github.com with: verify: false url: ${{ secrets.DISCORD_WEBHOOK }} # Evaluates the final outcome of the job to change the message dynamically title: "Homelab Deployment: ${{ job.status == 'success' && '✅ SUCCESS' || '❌ FAILED' }}" description: "The commit '${{ gitea.event.head_commit.message }}' by ${{ gitea.actor }} has finished processing." color: ${{ job.status == 'success' && '0x00FF00' || '0xFF0000' }}
Option B: Sending to Telegram
- Message
@BotFatheron Telegram to create a new bot and copy your Bot Token. - Message
@userinfobotto find your personal Chat ID. - Save these in Gitea Secrets as
TELEGRAM_TOKENandTELEGRAM_TO.name: Send Telegram Status Notificationif: always()uses: https://github.comwith:token: ${{ secrets.TELEGRAM_TOKEN }}to: ${{ secrets.TELEGRAM_TO }}message: |Homelab Deploy Status: ${{ job.status }}Actor: ${{ gitea.actor }}Commit: ${{ gitea.event.head_commit.message }}