File tree Expand file tree Collapse file tree 1 file changed +18
-28
lines changed Expand file tree Collapse file tree 1 file changed +18
-28
lines changed Original file line number Diff line number Diff line change 5
5
branches :
6
6
- master
7
7
8
+ env :
9
+ TKE_DOCKER_HUB : ccr.ccs.tencentyun.com
10
+ TKE_IMAGE_URL : ccr.ccs.tencentyun.com/hejunwei/machine-manage-api
11
+
8
12
jobs :
9
13
build :
10
14
runs-on : ubuntu-latest
@@ -16,31 +20,17 @@ jobs:
16
20
- name : Change env.lua
17
21
run : cp env.example.json env.json
18
22
19
- - name : Build and push
20
- uses : mr-smithers-excellent/docker-build-push@v5
21
- with :
22
- image : horan/lua-china
23
- registry : docker.io
24
- tags : $GITHUB_SHA
25
- username : horan
26
- password : ${{ secrets.DOCKERHUB_TOKEN }}
27
-
28
- deploy :
29
- runs-on : ubuntu-latest
30
- name : Deploy docker
31
- needs : build
32
- steps :
33
- - name : ssh pipelines
34
- uses : cross-the-world/ssh-pipeline@master
35
- env :
36
- WELCOME : " ssh pipeline"
37
- with :
38
- host : 115.28.82.133
39
- user : root
40
- pass : ${{ secrets.SSH_PASSWORD }}
41
- port : 22
42
- connect_timeout : 10s
43
- script : |
44
- (docker pull horan/lua-china:$GITHUB_SHA) &&
45
- (docker rm -f lua-china || true) &&
46
- docker run -p 10.31.231.178:8888:80 --name=lua-china -d horan/lua-china:$GITHUB_SHA
23
+ - name : Export Date Env
24
+ id : CURRENT_DATE
25
+ run : echo "::set-output name=date::$(TZ=Asia/Shanghai date +'%Y-%m-%d-%H-%M-%S')"
26
+
27
+ - name : Build the Docker image
28
+ run : docker build -t ${TKE_IMAGE_URL}:${{steps.CURRENT_DATE.outputs.date}} .
29
+
30
+ - name : Login TKE Registry
31
+ run : |
32
+ docker login ${TKE_DOCKER_HUB} --username="${{secrets.TENCENT_CLOUD_ACCOUNT_ID}}" -p "${{ secrets.TKE_REGISTRY_PASSWORD }}"
33
+
34
+ - name : Push docker image
35
+ run : |
36
+ docker push ${TKE_IMAGE_URL}:${{steps.CURRENT_DATE.outputs.date}}
You can’t perform that action at this time.
0 commit comments