Skip to content
This repository was archived by the owner on Apr 20, 2022. It is now read-only.

Commit a1f88d2

Browse files
authored
Merge pull request #126 from hardy4yooz/main
Add docker image to aliyun and oss
2 parents b1116ca + 6e3ae30 commit a1f88d2

File tree

1 file changed

+42
-4
lines changed

1 file changed

+42
-4
lines changed

.github/workflows/release_engine.yml

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ jobs:
3737
username: ${{ secrets.DONGTAI_DOCKERHUB_USERNAME }}
3838
password: ${{ secrets.DONGTAI_DOCKERHUB_TOKEN }}
3939

40+
- name: Login to AliyunRegistry
41+
uses: docker/login-action@v1
42+
with:
43+
registry: ${{secrets.ALIYUN_REGISTRY}}
44+
username: ${{secrets.ALIYUN_DOCKERHUB_USER}}
45+
password: ${{secrets.ALIYUN_DOCKERHUB_PASSWORD}}
46+
logout: true
47+
4048
- id: release
4149
run: |
4250
TAG_NAME=${{ github.event.release.tag_name }}
@@ -61,25 +69,54 @@ jobs:
6169
assets: |
6270
./version.txt:/iast/release-version/${{ github.event.repository.name }}/${{ steps.release.outputs.VERSION }}/version.txt
6371
72+
- name: Build to local
73+
uses: docker/build-push-action@v2
74+
with:
75+
context: .
76+
load: true
77+
tags: |
78+
dongtai/dongtai-engine:latest
79+
dongtai/dongtai-engine:${{ steps.release.outputs.version }}
80+
registry.cn-beijing.aliyuncs.com/huoxian_pub/dongtai-engine:latest
81+
registry.cn-beijing.aliyuncs.com/huoxian_pub/dongtai-engine:${{ steps.release.outputs.version }}
82+
83+
- name: Save image to tar file
84+
run: |
85+
docker save dongtai/dongtai-engine:${{ steps.release.outputs.version }} | gzip > /tmp/dongtai-engine-${{ steps.release.outputs.version }}.tar.gz
86+
6487
- name: Build and push
6588
uses: docker/build-push-action@v2
6689
with:
6790
context: .
6891
push: true
6992
tags: |
7093
dongtai/dongtai-engine:latest
71-
dongtai/dongtai-engine:${{ steps.release.outputs.VERSION }}
94+
dongtai/dongtai-engine:${{ steps.release.outputs.version }}
95+
registry.cn-beijing.aliyuncs.com/huoxian_pub/dongtai-engine:latest
96+
registry.cn-beijing.aliyuncs.com/huoxian_pub/dongtai-engine:${{ steps.release.outputs.version }}
7297
73-
- name: deploy Engine to PROD
98+
- name: Setup Ossutil
99+
uses: manyuanrong/setup-ossutil@v2.0
100+
with:
101+
endpoint: ${{ secrets.OSS_ENDPOINT }}
102+
access-key-id: ${{ secrets.OSS_KEY_ID }}
103+
access-key-secret: ${{ secrets.OSS_KEY_SECRET }}
104+
105+
- name: Upload images to oss
106+
run: |
107+
ossutil cp /tmp/dongtai-engine-${{ steps.release.outputs.version }}.tar.gz oss://huoqi-public/iast/server-package/${{ steps.release.outputs.version }}/
108+
109+
110+
- name: Deploy Engine to staging
74111
uses: wahyd4/kubectl-helm-action@master
75112
env:
76113
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}
77114
with:
78115
args: |
79116
find deploy/deploy-eks-iast-saas-engine-prod.yml -type f -exec sed -i 's/VERSION/${{ steps.release.outputs.VERSION }}/g' {} \;
80117
ls deploy/deploy-eks-iast-saas-engine-prod.yml | xargs -I {} kubectl apply -f {}
81-
82-
- name: deploy Engine Task to cluster
118+
119+
- name: Deploy engine Task to staging
83120
uses: wahyd4/kubectl-helm-action@master
84121
env:
85122
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}
@@ -88,6 +125,7 @@ jobs:
88125
find deploy/deploy-eks-iast-saas-engine-task-prod.yml -type f -exec sed -i 's/VERSION/${{ steps.release.outputs.VERSION }}/g' {} \;
89126
ls deploy/deploy-eks-iast-saas-engine-task-prod.yml | xargs -I {} kubectl apply -f {}
90127
128+
91129
- name: finish build
92130
uses: joelwmale/webhook-action@master
93131
with:

0 commit comments

Comments
 (0)