-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (40 loc) · 1.25 KB
/
main.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
name: Main workflow
on:
push:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
# Cache node modules and next folder
- name: 📬 Caching
uses: actions/cache@v2
with:
path: |
**/node_modules
${{ github.workspace }}/.next/cache
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: 🗝 Add Key
run: sed -i 's/\${process\.env\.TOKEN_NOMICS}/${{secrets.TOKEN_NOMICS}}/g' key.js
- name: 🗝 Add API url
run: sed -i 's/\${\"\"}/${{secrets.API_URL}}/g' constants.js
- name: 🧰 Install dependencies
run: npm ci
- name: 📦 Build project
run: npm run build --if-present
# Deploy to Netlify with a personalized message
- name: 🚀 Deploy to Netlify
id: deploy-netlify
uses: netlify/actions/cli@master
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
with:
args: deploy -m 'v1'