[GitHub Repo Event] ➔ [GitHub Actions Workflow] ➔ [Pinggy Tunnel] ➔ [Docker: .NET API] ➔ [Docker: MS SQL for Linux]
-
Spin Up the Stack with Docker Compose
sudo docker compose up -d
-
Expose Port 5000 Securely via Pinggy
Instead of installing an extra tunnel client, you can use SSH client to tunnel through Pinggy. Run this command in a new terminal window:
ssh -p 443 -R0:localhost:5000 public@a.pinggy.io
Pinggy will output a live public URL (e.g.,
https://pinggy.link). -
Configure the GitHub Actions Workflow
This repository contains a workflow file located at:
.github/workflows/notify-hub.yml
The workflow runs on every push and forwards a JSON payload to your local API through your tunneling URL. To activate it, you only need to provide your own public tunnel endpoint.
-
Set the
PINGGY_URLSecret-
Go to GitHub Settings Tab → Security and Quality → Secrets and variables → Actions
-
Create a new Repository secret named
PINGGY_URL -
Paste the public URL generated by your tunneling tool (e.g.,
https://abc123.pinggy.link/api/github/events).
-
Note: Watch out for double slashes in your
PINGGY_URL. If you copy and paste URL, you will likely have a double slash and this will cause POST 404 error.Once the secret is saved, every push will automatically trigger the workflow and send the payload to your local stack.
-
-
Trigger the Workflow
git commit --allow-empty -m "test webhook" git push -
Verify the Data Reached Your Local SQL Server
- View the API Logs
sudo docker logs --tail 30 dotnet_webhook_api
-
Connect to the SQL Server container
sudo docker exec -it sql_server_hub /opt/mssql-tools/bin/sqlcmd \ -S localhost -U sa -P "YourStrongPassword123!" -C \ -Q "SELECT * FROM NotificationHub.dbo.Notifications;"
-
Check the database interactively
sudo docker exec -it sql_server_hub /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P "YourStrongPassword123!" -C
USE NotificationHub; GO SELECT TOP 20 * FROM Notifications ORDER BY ReceivedAt DESC; GO