-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (67 loc) · 2.15 KB
/
build-develop.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
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Build and Test Develop
on:
push:
branches:
- develop
jobs:
develop-push:
name: 'Develop Testing'
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
slack-channel: ['build-monitoring']
steps:
- name: 'Notify build start'
uses: voxmedia/github-action-slack-notify-build@v1
id: slack
with:
channel: ${{ matrix.slack-channel }}
status: STARTED
color: warning
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
- name: 'Checkout'
uses: actions/checkout@master
- name: 'Use Node.js ${{ matrix.node-version }}'
uses: actions/setup-node@v1
with:
always-auth: true
node-version: ${{ matrix.node-version }}
- name: 'NPM Test'
shell: bash
run: |
npm install -g gulp-cli gulp@4
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
npm config set registry http://registry.npmjs.org
npm config set always-auth true
sudo mkdir ~/.npm || true
sudo chown -R $USER:$GROUP ~/.npm || true
sudo chown -R $USER:$GROUP ~/.config || true
npm ci
gulp
npm run coverage
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
- name: Notify slack success
if: success()
uses: voxmedia/github-action-slack-notify-build@v1
with:
# Updates existing message from the first step
message_id: ${{ steps.slack.outputs.message_id }}
channel: ${{ matrix.slack-channel }}
status: SUCCESS
color: good
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
- name: Notify slack fail
if: failure()
uses: voxmedia/github-action-slack-notify-build@v1
with:
message_id: ${{ steps.slack.outputs.message_id }}
channel: ${{ matrix.slack-channel }}
status: FAILED
color: danger
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}