-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (72 loc) · 1.98 KB
/
CI.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
name: CI
on: push
jobs:
test:
name: Lint and Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Use Node.js
uses: actions/setup-node@master
with:
node-version: "10.x"
- uses: c-hive/gha-npm-cache@v1
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Tests
run: npm run test
- name: TSC
run: npm run tsc
build:
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop'
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Use Node.js
uses: actions/setup-node@master
with:
node-version: "10.x"
- uses: actions/cache@v2
id: cache
with:
path: |
~/.npm
${{ github.workspace }}/.next/cache
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-next
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- uses: actions/upload-artifact@master
if: github.ref == 'refs/heads/master'
with:
name: build
path: .next
FTP-Deploy-Action:
name: FTP-Deploy-Action
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
needs: [test, build]
steps:
- uses: actions/checkout@master
- uses: actions/download-artifact@master
with:
name: build
path: .next
- uses: c-hive/gha-npm-cache@v1
- name: Install dependencies
run: npm ci
- name: export
run: npm run export
- name: FTP-Deploy-Action
uses: SamKirkland/FTP-Deploy-Action@3.1.1
with:
ftp-server: ${{ secrets.HOST }}/${{ secrets.HOST_PATH }}
ftp-username: ${{ secrets.FTP_USER }}
ftp-password: ${{ secrets.PASSWORD }}
local-dir: src/out