Skip to content

Commit 4712f00

Browse files
authored
feature: add the pipeline for pushing images to Huawei Cloud (#167)
1 parent c51058a commit 4712f00

File tree

2 files changed

+120
-0
lines changed

2 files changed

+120
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: docker-push-to-huaweicloud-reusable.yml
2+
on:
3+
workflow_call:
4+
inputs:
5+
version:
6+
description: 'image version (e.g. latest or v0.0.1-beta)'
7+
required: true
8+
default: 'latest'
9+
type: string
10+
service_name:
11+
description: 'image version (e.g. latest or v0.0.1-beta)'
12+
required: true
13+
default: 'latest'
14+
type: string
15+
secrets:
16+
HUAWEI_CLOUD_SWR_LOGIN_PWD:
17+
description: 'login pwd'
18+
required: true
19+
20+
jobs:
21+
retag-and-push:
22+
name: Retag and Push to Huawei Cloud SWR
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Pull source image and retag (amd)
26+
shell: bash
27+
run: |
28+
SOURCE_IMAGE=ghcr.io/modelengine-group/${{ inputs.service_name}}:${{ inputs.version}}
29+
TARGET_IMAGE=swr.cn-east-3.myhuaweicloud.com/data-mate/${{ inputs.service_name}}:${{ inputs.version}}
30+
docker pull "${SOURCE_IMAGE}"
31+
docker tag "${SOURCE_IMAGE}" "${TARGET_IMAGE}"-amd
32+
- name: Pull source image and retag (arm)
33+
shell: bash
34+
run: |
35+
SOURCE_IMAGE=ghcr.io/modelengine-group/${{ inputs.service_name}}:${{ inputs.version}}
36+
TARGET_IMAGE=swr.cn-east-3.myhuaweicloud.com/data-mate/${{ inputs.service_name}}:${{ inputs.version}}
37+
docker pull "${SOURCE_IMAGE}" --platform=linux/arm64
38+
docker tag "${SOURCE_IMAGE}" "${TARGET_IMAGE}"-arm
39+
- name: Push image to Huawei SWR using
40+
shell: bash
41+
run: |
42+
TARGET_IMAGE=swr.cn-east-3.myhuaweicloud.com/data-mate/${{ inputs.service_name}}:${{ inputs.version}}
43+
echo "${{ secrets.HUAWEI_CLOUD_SWR_LOGIN_PWD}}" | docker login swr.cn-east-3.myhuaweicloud.com --username=cn-east-3@HPUA3ZGOTQFAFMM59DB9 --password-stdin
44+
docker push "${TARGET_IMAGE}"-amd
45+
docker push "${TARGET_IMAGE}"-arm
46+
docker manifest create "${TARGET_IMAGE}" "${TARGET_IMAGE}"-amd "${TARGET_IMAGE}"-arm
47+
docker manifest push "${TARGET_IMAGE}"
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: docker-push-to-huaweicloud.yml
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version:
6+
description: 'image version (e.g. latest or v0.0.1-beta)'
7+
required: true
8+
default: 'latest'
9+
type: string
10+
11+
jobs:
12+
frontend:
13+
name: Push Frontend Image
14+
uses: ./.github/workflows/docker-push-to-huaweicloud-reusable.yml
15+
with:
16+
service_name: datamate-frontend
17+
version: ${{ inputs.version}}
18+
secrets:
19+
HUAWEI_CLOUD_SWR_LOGIN_PWD: ${{ secrets.HUAWEI_CLOUD_SWR_LOGIN_PWD}}
20+
21+
backend:
22+
name: Push Backend Image
23+
uses: ./.github/workflows/docker-push-to-huaweicloud-reusable.yml
24+
with:
25+
service_name: datamate-backend
26+
version: ${{ inputs.version}}
27+
secrets:
28+
HUAWEI_CLOUD_SWR_LOGIN_PWD: ${{ secrets.HUAWEI_CLOUD_SWR_LOGIN_PWD}}
29+
30+
backend-python:
31+
name: Push Backend-Python Image
32+
uses: ./.github/workflows/docker-push-to-huaweicloud-reusable.yml
33+
with:
34+
service_name: datamate-backend-python
35+
version: ${{ inputs.version}}
36+
secrets:
37+
HUAWEI_CLOUD_SWR_LOGIN_PWD: ${{ secrets.HUAWEI_CLOUD_SWR_LOGIN_PWD}}
38+
39+
runtime:
40+
name: Push Runtime Image
41+
uses: ./.github/workflows/docker-push-to-huaweicloud-reusable.yml
42+
with:
43+
service_name: datamate-runtime
44+
version: ${{ inputs.version}}
45+
secrets:
46+
HUAWEI_CLOUD_SWR_LOGIN_PWD: ${{ secrets.HUAWEI_CLOUD_SWR_LOGIN_PWD}}
47+
48+
database:
49+
name: Push Database Image
50+
uses: ./.github/workflows/docker-push-to-huaweicloud-reusable.yml
51+
with:
52+
service_name: datamate-database
53+
version: ${{ inputs.version}}
54+
secrets:
55+
HUAWEI_CLOUD_SWR_LOGIN_PWD: ${{ secrets.HUAWEI_CLOUD_SWR_LOGIN_PWD}}
56+
57+
deer-flow-backend:
58+
name: Push deer-flow-backend Image
59+
uses: ./.github/workflows/docker-push-to-huaweicloud-reusable.yml
60+
with:
61+
service_name: deer-flow-backend
62+
version: ${{ inputs.version}}
63+
secrets:
64+
HUAWEI_CLOUD_SWR_LOGIN_PWD: ${{ secrets.HUAWEI_CLOUD_SWR_LOGIN_PWD}}
65+
66+
deer-flow-frontend:
67+
name: Push deer-flow-frontend Image
68+
uses: ./.github/workflows/docker-push-to-huaweicloud-reusable.yml
69+
with:
70+
service_name: deer-flow-frontend
71+
version: ${{ inputs.version}}
72+
secrets:
73+
HUAWEI_CLOUD_SWR_LOGIN_PWD: ${{ secrets.HUAWEI_CLOUD_SWR_LOGIN_PWD}}

0 commit comments

Comments
 (0)