100% Serverless Website to Telegram Channel Automation
How any new blog post automatically triggers an instant broadcast to a Telegram channel using zero-cost GitHub Actions.
When maintaining a personal developer blog, one of the most tedious manual tasks is sharing newly published posts across social channels like Telegram.
We have fully automated this workflow! Now, whenever a new Markdown (.md) file is committed to the repository via git push, a real-time notification is instantly broadcasted directly to our Telegram channel—without paying for a 24/7 VPS or third-party webhooks.
How does it work without a dedicated server?
Most developers assume running a Telegram bot requires a continuously running Node.js or Python background service. However, since our codebase lives on GitHub, we leverage GitHub Actions as an ephemeral serverless execution engine!
graph LR
A[New post.md committed] --> B[GitHub Repository]
B --> C[Cloudflare Pages Build]
B --> D[GitHub Actions Workflow]
D --> E[Telegram Channel Broadcast ✈️]
The Workflow Step-by-Step
- Commit Analysis: When a push hits
main, our custom Node script (notify-telegram.mjs) parsesgit diffto identify freshly added.mdfiles. - Frontmatter Extraction: It reads the metadata (
title,description,tags) and verifies thatdraft: trueis not set. - Telegram Bot API: The extracted details are formatted into clean HTML markup and dispatched via a secure
fetch()request directly to Telegram'ssendMessageendpoint.
Conclusion
By combining static JAMstack rendering with event-driven GitHub Actions, we achieve an ultra-fast, zero-maintenance publishing pipeline. Write markdown, push to main, and let the automation handle the rest!