-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (96 loc) · 2.66 KB
/
master.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Master - Build and Deploy
on:
push:
branches:
- master
jobs:
re-check:
strategy:
fail-fast: false
matrix:
command:
- lint
- test
name: ${{ matrix.command }}
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'yarn'
- name: 'Install dependencies'
run: yarn install --immutable
- name: 'Run ${{ matrix.command }}'
run: yarn ${{ matrix.command }}
deploy:
runs-on: ubuntu-latest
needs: [re-check]
strategy:
fail-fast: false
matrix:
repo:
- csi-lk/csi.lk
- csi-lk/callumsilcock.com
- csi-lk/xn--ev9h.ml # 🧔
- csi-lk/xn--g5hx212o.ml # 🧔♂️
steps:
- name: 'Cache'
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'yarn'
- name: 'Install dependencies'
run: yarn install --immutable
- name: 'Build'
run: yarn build:prod
- name: 'Deploy csi.lk'
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
REPOSITORY_NAME: ${{ matrix.repo }}
BRANCH: gh-pages
FOLDER: dist
GIT_CONFIG_NAME: Callum Silcock
GIT_CONFIG_EMAIL: [email protected]
smoke-test:
needs: [deploy]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'yarn'
- name: 'Install dependencies'
run: yarn install --immutable
- name: 'Smoke test'
run: yarn e2e:prod
notify:
runs-on: ubuntu-latest
needs: [smoke-test, deploy]
steps:
- name: Slack Notification
uses: rtCamp/action-slack-notify@master
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_COLOR: '#000'
SLACK_ICON: https://raw.githubusercontent.com/github/explore/master/topics/actions/actions.png
SLACK_MESSAGE: 'Deployed https://csi.lk to production :rocket:'
SLACK_TITLE: Production Deployment
SLACK_USERNAME: deployBot