-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (79 loc) · 2.57 KB
/
Build.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
name: CI/CD Convey Production
on:
push:
branches:
- master
schedule:
- cron: "0 6 * * *"
repository_dispatch:
types: build-static-production
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
# Virtual envs : https://help.github.com/en/articles/virtual-environments-for-github-actions
os: [ubuntu-latest]
node-version: [16.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Yarn cache directory
id: yarn-cache-dir
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Yarn cache
uses: actions/cache@v1
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir.outputs.dir }}
key: ${{ matrix.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ matrix.os }}-yarn-
- name: yarn install, build, and test
env:
CI: "true"
SUPABASE_URL: ${{ secrets.SUPABASE_URL_PRODUCTION }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY_PRODUCTION }}
run: |
yarn install
yarn start
- uses: amondnet/vercel-action@v19
with:
vercel-token: ${{ secrets.ZEIT_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_AUGORA_ORGID }}
vercel-project-id: ${{ secrets.ZEIT_PROJECTID_CONVEY }}
vercel-project-name: augora
github-comment: false
alias-domains: |
static.augora.fr
- uses: 8398a7/action-slack@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: always()
with:
status: custom
fields: workflow,job,commit
custom_payload: |
{
username: '[Convey]',
icon_emoji: ':handshake:',
attachments: [
{
color: '${{ job.status }}' === 'success' ? '#28a745' : '${{ job.status }}' === 'failure' ? '#dc3545' : '#ffc107',
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": '${{ job.status }}' === 'success' ? "Deployment succeeded!" : "Deployment failed..."
}
}
]
}
]
}