This repository contains a collection of actions and workflows that can be used in your GitHub Actions and Workflows. It tests, builds, creates pull requests and deploys preprod/prod environments to Firebase while notifying your Slack channel after each action (e.g., test, build, create PR, deployment) with its status (e.g., success, fail). Messages and workflows are highly customizable.
It also contains set of actions from the GitHub Actions Marketplace. They are:
- actions/checkout@v3
- tj-actions/branch-names@v6
- actions/setup-node@v3
- rtCamp/action-slack-notify@v2
- devops-infra/[email protected]
- FirebaseExtended/action-hosting-deploy@v0
- Test
feature/*
branch on push to remote - Notify Slack channel on test success/fail
- If test success, create pull request from
feature/*
tomaster
branch - Notify Slack channel on pull request creation success/fail
- If create PR success, deploy this
feature/*
branch to preproduction environment. The deployment link is sent to the Slack channel. - Notify Slack channel on deployment success/fail
- Merge pull request to
master
branch (this is manuel action) - Test
master
branch on push tomaster
- Notify Slack channel on test success/fail
- If test success, deploy
master
branch to production environment. The deployment link is sent to the Slack channel. - Notify Slack channel on deployment success/fail
To use this workflow, you can copy the entire .github folder and paste it into your root directory. Then, you can modify the workflows to suit your needs.
You need to create a GitHub Secrets named;
CHANNEL_NAME
and set its value to your Slack channel name. (e.g., general, random)PAT
and set its value to your GitHub Personal Access Token. Needs to have repo scope access. Refer hereSLACK_WEBHOOK
and set its value to your Slack webhook URL. Get one here.FIREBASE_SERVICE_ACCOUNT
and set its value to your Firebase token. Create one here.
You can provide your Slack Message icon by modifying the SLACK_ICON
in the slack-notifier file.
Please refer the action links above for more information and customization.
To use custom emojis in your Slack notification, you can use this list. Download emojis you want to use and upload them to your Slack workspace. Then, you can use them in your Slack notification text.
On test success after merge to master
branch
On test fail on feature/instagram
branch