generated from penseapp/template-npm-package
-
Notifications
You must be signed in to change notification settings - Fork 0
124 lines (106 loc) · 3.78 KB
/
deploy.yml
File metadata and controls
124 lines (106 loc) · 3.78 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: Build and Deploy
on:
push:
branches:
- master
jobs:
build:
name: Build uselocalstorage react frontend
runs-on: ubuntu-latest
steps:
- name: Discord notification - start build
uses: rjstone/discord-webhook-notify@v1.0.4
with:
severity: info
text: ${{github.repository}} - ${{github.workflow}}
details: "- **Pipeline:** https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
webhookUrl: ${{ secrets.DISCORD_CHANNEL_WEBHOOK }}
- name: Checkout Repo
uses: actions/checkout@master
- name: Install Dependencies
run: yarn
- name: Check lint
run: yarn lint
# - name: Check tests
# run: yarn test
- name: Build
run: yarn build:all
- name: "Automated Version Bump"
uses: "phips28/gh-action-bump-version@master"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
skip-tag: "true"
- name: Generate dist artifact for package
uses: actions/upload-artifact@v2
with:
name: dist-folder
path: dist/**/*
- name: Discord notification - finished build (Success)
if: success()
uses: rjstone/discord-webhook-notify@v1.0.4
with:
severity: success
description: Finished the build pipeline, starting deploys
webhookUrl: ${{ secrets.DISCORD_CHANNEL_WEBHOOK }}
- name: Discord notification - finished build (error)
if: failure()
uses: rjstone/discord-webhook-notify@v1.0.4
with:
severity: error
description: Build uselocalstorage react frontend failed
webhookUrl: ${{ secrets.DISCORD_CHANNEL_WEBHOOK }}
- name: Discord notification - finished build (cancelled)
if: cancelled()
uses: rjstone/discord-webhook-notify@v1.0.4
with:
severity: warn
description: Build uselocalstorage react frontend cancelled
webhookUrl: ${{ secrets.DISCORD_CHANNEL_WEBHOOK }}
publish:
name: Generates new release and publish
needs: [build]
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- name: Checkout Repo
uses: actions/checkout@master
- uses: actions/download-artifact@v2
with:
name: dist-folder
path: dist
- name: Publish on NPM
uses: mikeal/merge-release@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: release on Github
uses: rymndhng/release-on-push-action@master
with:
bump_version_scheme: patch
- name: Notify discord
if: success()
uses: rjstone/discord-webhook-notify@v1.0.4
with:
severity: success
description: Deploy finished - new release deployed
details: |
**- Tag name:** ${{ steps.release.outputs.tag_name }}
**- Release version:** ${{ steps.release.outputs.version }}
webhookUrl: ${{ secrets.DISCORD_CHANNEL_WEBHOOK }}
- name: Discord notification - Github generated release (error)
if: failure()
uses: rjstone/discord-webhook-notify@v1.0.4
with:
severity: error
description: Github generated release failed
webhookUrl: ${{ secrets.DISCORD_CHANNEL_WEBHOOK }}
- name: Discord notification - Github generated release (cancelled)
if: cancelled()
uses: rjstone/discord-webhook-notify@v1.0.4
with:
severity: warn
description: Github generated release cancelled
webhookUrl: ${{ secrets.DISCORD_CHANNEL_WEBHOOK }}