File tree Expand file tree Collapse file tree 1 file changed +54
-0
lines changed
Expand file tree Collapse file tree 1 file changed +54
-0
lines changed Original file line number Diff line number Diff line change 1+ # 部署到服务器
2+ name : Deploy-ESC
3+
4+ on :
5+ push : # 推送的时候触发
6+ # branches: [ "master" ] # 推送的分支
7+ # Publish semver tags as releases.
8+ # tags: [ 'v*.*.*' ]
9+ # 手动触发部署
10+ workflow_dispatch :
11+ # pull_request:
12+ # branches: [ "next" ]
13+
14+ env :
15+ # 仓库地址
16+ REGISTRY : registry.cn-hangzhou.aliyuncs.com
17+ UserName : mmdapl
18+
19+
20+ jobs :
21+ Deploy-ESC :
22+ name : " 部署到ESC"
23+ runs-on : ubuntu-latest
24+ permissions :
25+ contents : read
26+ packages : write
27+ # This is used to complete the identity challenge
28+ # with sigstore/fulcio when running outside of PRs.
29+ id-token : write
30+
31+ steps :
32+ - name : Checkout repository
33+ uses : actions/checkout@v3
34+
35+ - name : 读取当前版本号
36+ id : version
37+ uses : ashley-taylor/read-json-property-action@v1.0
38+ with :
39+ path : ./package.json
40+ property : version
41+ # 拉取镜像,更新服务
42+ - name : Pull Image And Update ESC
43+ uses : appleboy/ssh-action@master
44+ with :
45+ host : ${{ secrets.Server_Host }}
46+ port : ${{ secrets.Server_Port }}
47+ username : ${{ secrets.Server_UserName }}
48+ password : ${{ secrets.Server_Password }}
49+ script : |
50+ docker images &&
51+ echo "-----------正在运行的服务--------" &&
52+ docker ps &&
53+ cd //service_env/ && git reset --hard && git pull origin main &&
54+ bash ./scripts/book_doc.deploy.sh jsc ${{steps.version.outputs.value}}
You can’t perform that action at this time.
0 commit comments