-
Notifications
You must be signed in to change notification settings - Fork 25
61 lines (53 loc) · 1.97 KB
/
prerelease-notify.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Prerelease notify
on:
repository_dispatch:
types: [deploy_success]
jobs:
prerelease-notify:
name: Prerelease 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#*preprod-}" >> $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-prerelease-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, 'preprod-') && 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: "preprod"