Skip to content

Commit c6ac3c2

Browse files
authored
Merge pull request #32 from mmdapl/master
feat(ci): add code-ci for eslint
2 parents 12aa003 + b60319c commit c6ac3c2

File tree

4 files changed

+77
-8
lines changed

4 files changed

+77
-8
lines changed

.github/workflows/code-ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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

.github/workflows/docker-image.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ name: Docker-Image
33

44
## 触发条件
55
on:
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
## 环境变量
2020
env:

.github/workflows/esc-deploy.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,37 @@ env:
1313

1414

1515
jobs:
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'

.github/workflows/gh-deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: gh-deploy
33
on:
44
push:
55
branches:
6+
- master
67
- next
78
workflow_dispatch:
89

0 commit comments

Comments
 (0)