deploy_success #248
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release notify | |
on: | |
repository_dispatch: | |
types: [deploy_success] | |
jobs: | |
release-notify: | |
name: Release notify | |
runs-on: ubuntu-latest | |
concurrency: | |
group: ${{ github.event.client_payload.imageTag }} | |
cancel-in-progress: false | |
permissions: | |
contents: read # This is required for actions/checkout | |
id-token: write # This is required for requesting the JWT | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Read version | |
id: version | |
shell: bash | |
run: echo "version=${RELEASE_TAG#*prod-}" >> $GITHUB_OUTPUT | |
env: | |
RELEASE_TAG: ${{ github.event.client_payload.imageTag }} | |
- name: Cache release tag | |
id: cache-release-tag | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-release-tag | |
with: | |
path: ./package.json | |
key: swan-partner-frontend-deploy-${{ steps.version.outputs.version }} | |
- uses: actions/setup-node@v3 | |
if: ${{ steps.cache-release-tag.outputs.cache-hit != 'true' }} | |
with: | |
node-version: lts/* | |
cache: yarn | |
- name: Install dependencies | |
if: ${{ steps.cache-release-tag.outputs.cache-hit != 'true' }} | |
run: yarn install --pure-lockfile | |
- name: Get changelog | |
if: ${{ steps.cache-release-tag.outputs.cache-hit != 'true' }} | |
id: changelog | |
run: yarn -s ci-get-changelog | |
env: | |
GITHUB_TOKEN: $${{ secrets.NOTIFY_GH_TOKEN }} | |
RELEASE_TAG: ${{ github.event.client_payload.imageTag }} | |
- name: Notify on Slack | |
if: ${{ startsWith(github.event.client_payload.imageTag, 'prod-') && steps.cache-release-tag.outputs.cache-hit != 'true' }} | |
uses: bloodyowl/[email protected] | |
with: | |
version: ${{ steps.version.outputs.version }} | |
changelog: ${{ steps.changelog.outputs.body }} | |
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }} | |
environment: "prod" |