Slack Announcements on Site Provision

Overview

This document guides you through the process of setting up Slack announcements notification on site provision for your project. By following these instructions, you can automatically receive site information as a notification on the associated channel when provision is completed. This feature ensures better communication and visibility during the development process.

Slack app showing Harbor announcements

Create a Slack App

Begin by creating a new Slack app within your Slack workspace. Once your Slack app is created, obtain its OAuth Access token. Then, invite the Slack app you created into the channel where you want to announce the deployments.

Add Slack OAuth Access Token to GitHub Secrets

Navigate to your GitHub repository settings and create a new secret with the OAuth Access token obtained from Slack.

Configure Environment Variables

Edit the preview-provision.yml workflow file in your Laravel Harbor CLI app. Add the following environment variables:

SLACK_ANNOUNCEMENT_ENABLED: true
SLACK_BOT_USER_OAUTH_TOKEN: ${{ secrets.SLACK_BOT_USER_OAUTH_TOKEN }}
SLACK_CHANNEL: "#deployments"  # Replace this with the channel where you invited the Slack app

Note:

The Slack Notification will only be sent when the site is first created. Subsequent pushes to the same PR won't trigger the notification.