-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (94 loc) · 3.46 KB
/
github-actions.yml
File metadata and controls
100 lines (94 loc) · 3.46 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
name: Spinoco webchat plugin github actions
on: [ push ]
permissions:
contents: read
pages: write
id-token: write
jobs:
install:
runs-on: ubuntu-latest
steps:
- uses: docker://node:18.19.0-buster-slim
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: node_modules
key: ${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- run: npm i --production=false --legacy-peer-deps
lint:
needs: [ install ]
runs-on: ubuntu-latest
steps:
- uses: docker://node:18.19.0-buster-slim
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: node_modules
key: ${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- run: npm run eslint
build-main:
needs: [ lint ]
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: docker://node:18.19.0-buster-slim
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: node_modules
key: ${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- run: npm run build
- uses: actions/upload-artifact@v3
with:
name: pages-main
path: dist
build-staging:
needs: [ lint ]
if: github.ref == 'refs/heads/staging'
runs-on: ubuntu-latest
steps:
- uses: docker://node:18.19.0-buster-slim
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: node_modules
key: ${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- run: npm run build
- uses: actions/upload-artifact@v3
with:
name: pages-staging
path: dist
deploy-main:
needs: [ build-main ]
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment: main
steps:
- uses: actions/download-artifact@v3
with:
name: pages-main
path: .
- uses: actions/configure-pages@v1
- uses: actions/upload-pages-artifact@v1
with:
path: .
- uses: actions/deploy-pages@v1
deploy-staging:
needs: [ build-staging ]
if: github.ref == 'refs/heads/staging'
runs-on: ubuntu-latest
environment: staging
steps:
- uses: actions/download-artifact@v3
with:
name: pages-staging
path: .
- uses: actions/configure-pages@v1
- uses: actions/upload-pages-artifact@v1
with:
path: .
- uses: actions/deploy-pages@v1