-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·50 lines (41 loc) · 1.23 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
name: CI
on:
push:
branches: [ "master" ]
jobs:
release:
runs-on: ubuntu-latest
# strategy:
# matrix:
# node-version: [18.x, 20.x]
steps:
- name: Checkout Source Code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js Environment (use node 18)
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Cache Dependences
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# 需要缓存的文件的路径
path: ./node_modules
# 对缓存的文件指定的唯一标识
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./package.json') }}
# 用于没有再找目标key的缓存的backup选项
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Init Project
run: npm run initial
- name: Build Project
run: npm run build
- name: Release Docker Image
run: |
chmod +x ./release.sh
DOCKER_REPO=${{ secrets.DOCKER_REPO }} DOCKER_USER=${{ secrets.DOCKER_USER }} DOCKER_PASS=${{ secrets.DOCKER_PASS }} ./release.sh