-
Notifications
You must be signed in to change notification settings - Fork 0
175 lines (151 loc) · 5.33 KB
/
deploy.yml
File metadata and controls
175 lines (151 loc) · 5.33 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
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: npm run i-all
- name: Check lint
run: yarn lint
# - name: Check tests
# run: yarn test
- name: Build
run: npm run build:all
- name: Generate dist artifact for package
uses: actions/upload-artifact@v2
with:
name: dist-folder
path: dist/**/*
- name: Archive playground Artifact
uses: actions/upload-artifact@master
with:
name: playground-artifact
path: |
./playground/build
./playground/firebase.json
./playground/.firebaserc
if-no-files-found: error
- 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: "Automated Version Bump"
uses: "phips28/gh-action-bump-version@master"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
skip-tag: "true"
- 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 }}
deploy-firebase:
name: Deploy on Firebase
needs: [publish]
runs-on: ubuntu-latest
steps:
- name: Download Playground Artifact
uses: actions/download-artifact@master
with:
name: playground-artifact
- name: Deploy to Firebase
uses: w9jds/firebase-action@master
with:
args: deploy
env:
FIREBASE_TOKEN: ${{ secrets.USELOCALSTORAGE_FIREBASE_TOKEN }}
- name: Discord notification - deploy (success)
if: success()
uses: rjstone/discord-webhook-notify@v1.0.4
with:
severity: info
description: Deploy finished - uselocalstorage
webhookUrl: ${{ secrets.DISCORD_CHANNEL_WEBHOOK }}
- name: Discord notification - deploy (error)
if: failure()
uses: rjstone/discord-webhook-notify@v1.0.4
with:
severity: error
description: Deploy failed
webhookUrl: ${{ secrets.DISCORD_CHANNEL_WEBHOOK }}
- name: Discord notification - deploy (cancelled)
if: cancelled()
uses: rjstone/discord-webhook-notify@v1.0.4
with:
severity: warn
description: Deploy cancelled
webhookUrl: ${{ secrets.DISCORD_CHANNEL_WEBHOOK }}