Bonus: Also notify your followers on every update!
This project follows the DEV.to #ActionsHackathon21 hackathon.
Use GitHub Actions and Workflows to build and release your application on every release tag.
Then send an announcement to your Telegram channel about the new release
Check the complete workflow here (release-on-tag.yml)
- actions/checkout@v2 To checkout the source code from the repository
- actions/cache@v2 To cache the dependencies, allow us to re use them for future builds
- marvinpinto/action-automatic-releases@latest To release your build to Github Release page
(Also actions/setup-node@v2 for setup nodejs, although it's not required)
- You can config the release tag prefix, with
on.push.tags
key. - To send announcement to Telegram, you need to configure the workflow using following steps:
- Talk with Telegram's @BotFather to create a new bot if you don't have one. We will use this bot to send messages to the Telegram channel. He will give you the token access the HTTP API.
- On your Telegram channel, grant admin permissions to the bot.
- Set the
TELEGRAM_CHANNEL
variable. - Add the
TELEGRAM_BOT_TOKEN
secret (using the token access above) into your repository secret (Settings > Secrets > New repository secret)
In this repository, I use a sample NextJS to demonstrate. However you can change the workflow a bit to fit your project.
- Use actions/checkout@v2 to checkout source code from the repository
- Use actions/setup-node@v2 to setup nodejs
- Use actions/cache@v2 to cache dependencies (
node_modules
and.yarn
directories) - Install dependencies with
yarn
- Run tests
- Build application
- Prepare release build files
- Release the prepared files into Github Release
- Send an announcement to the specified Telegram channel
There is also a pre-release workflow (prerelease-on-push.yml), which will build and create a pre-release version of your application, on every push to main
branch.