File tree Expand file tree Collapse file tree 4 files changed +77
-8
lines changed
Expand file tree Collapse file tree 4 files changed +77
-8
lines changed Original file line number Diff line number Diff line change 1+ # 构建Docker镜像
2+ name : Code-CI
3+
4+ # # 触发条件
5+ on :
6+ # 手动触发部署
7+ workflow_dispatch :
8+ pull_request :
9+ branches :
10+ - ' master'
11+ - ' next'
12+ - ' !pages/**'
13+
14+ jobs :
15+ Code-CI :
16+ runs-on : ubuntu-latest
17+ # if: github.repository == '142vip/JavaScriptCollection'
18+ permissions :
19+ actions : read
20+ pull-requests : read
21+
22+ steps :
23+ - name : Checkout repository
24+ uses : actions/checkout@v3
25+
26+ - name : PNPM Install
27+ uses : pnpm/action-setup@v2
28+ with :
29+ version : 7
30+ node-version : 14.20.1
31+ run_install : true
32+ # 缓存 pnpm 依赖
33+ cache : pnpm
34+
35+ - name : Code Eslint Fix
36+ run : pnpm lintfix
37+ - name : Build Site
38+ run : pnpm build
Original file line number Diff line number Diff line change @@ -3,18 +3,18 @@ name: Docker-Image
33
44# # 触发条件
55on :
6- push :
7- branches :
8- - master
9- - next
6+ # push:
7+ # branches:
8+ # - master
9+ # - next
1010 # Publish semver tags as releases.
1111# tags: [ 'v*.*.*' ]
1212 # 手动触发部署
1313 workflow_dispatch :
14- pull_request :
15- branches :
16- - master
17- - next
14+ # pull_request:
15+ # branches:
16+ # - master
17+ # - next
1818
1919# # 环境变量
2020env :
Original file line number Diff line number Diff line change 1313
1414
1515jobs :
16+ Docker-Image :
17+ name : " 构建Docker镜像"
18+ runs-on : ubuntu-latest
19+ if : github.repository == '142vip/JavaScriptCollection'
20+ permissions :
21+ actions : read
22+ pull-requests : read
23+
24+ steps :
25+ - name : Checkout repository
26+ uses : actions/checkout@v3
27+
28+ - name : Login Docker
29+ run : |
30+ docker version
31+ echo "-----------Docker Login-----------"
32+ docker login --username=${{ env.UserName }} --password=${{ secrets.DOCKER_PASSWORD }} ${{env.REGISTRY}}
33+
34+ - name : PNPM Install
35+ uses : pnpm/action-setup@v2
36+ with :
37+ version : 7
38+ node-version : 14.20.1
39+ run_install : true
40+ # 缓存 pnpm 依赖
41+ cache : pnpm
42+ - name : Build And Push Docker image
43+ run : PROXY_DOMAIN=true pnpm faster-image
44+
1645 Deploy-ESC :
46+ needs : Docker-Image
1747 name : " 部署到ESC"
1848 runs-on : ubuntu-latest
1949 if : github.repository == '142vip/JavaScriptCollection'
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ name: gh-deploy
33on :
44 push :
55 branches :
6+ - master
67 - next
78 workflow_dispatch :
89
You can’t perform that action at this time.
0 commit comments