-
Notifications
You must be signed in to change notification settings - Fork 15
59 lines (50 loc) · 1.41 KB
/
publish.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
name: NPM Publish
on:
push:
tags:
- "v*"
jobs:
build:
name: Test and Publish
runs-on: ubuntu-latest
steps:
- name: Slack Notification Start
id: slack
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel_id: C02K52UNL0N
status: STARTED
color: FFA500
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}
- name: Checkout
uses: actions/checkout@v2
- name: Install
run: npm ci
- name: Test
run: npm run test
- name: Publish
if: ${{ github.event_name == 'push' }}
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
- name: Notify Success Status
if: success()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1
with:
message_id: ${{ steps.slack.outputs.message_id }}
channel_id: C02K52UNL0N
status: SUCCESS
color: good
- name: Notify Fail Status
if: failure()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1
with:
message_id: ${{ steps.slack.outputs.message_id }}
channel_id: C02K52UNL0N
status: FAILURE
color: danger