How to get a Slack Message after you Deploy to Firebase Hosting πŸš€

First, we’re going to build your Slack bot.

Go to https://api.slack.com/ and click “Start building”

A pop up like the one above should show up, name your App and select your Development Slack Workspace.

This should lead you to the page above.

Activate Incoming Webhooks to sliding it to “On”

Afterwards, click on “Add New Webhook to Workspace” and then select a channel that you want it to post as an app. This should then give you your webhook URL. Copy the Sample curl request onto a messageSlack.sh file into your app where your firebase.json is stored as well.

On your firebase.json file, add “postdeploy” or you could also change the text in messageSlack.sh to

curl -X POST -H 'Content-type: application/json' --data '{"text":"Just deployed a new feature πŸš€"}' 
https://hooks.slack.com/services/{YOUR_WEBHOOK_CUSTOM_URL_}

After the firebase init command, your firebase.json might be overwritten, so make sure to add “postdeploy” to firebase.json again.

Afterwards, you should get a message on Slack with your app that you just deployed to Firebase Hosting!

Resources: https://api.slack.com/, https://firebase.google.com/docs/cli

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.