Skip to content

Commit e20e798

Browse files
committed
ci: test combine two images
1 parent beb7ceb commit e20e798

1 file changed

Lines changed: 98 additions & 98 deletions

File tree

.github/workflows/base_ci.yml

Lines changed: 98 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -14,114 +14,114 @@ concurrency:
1414
cancel-in-progress: true
1515

1616
jobs:
17-
build_bisheng_arm:
18-
runs-on: ubuntu-latest
19-
# if: startsWith(github.event.ref, 'refs/tags')
20-
steps:
21-
- name: checkout
22-
uses: actions/checkout@v2
17+
# build_bisheng_arm:
18+
# runs-on: ubuntu-latest
19+
# # if: startsWith(github.event.ref, 'refs/tags')
20+
# steps:
21+
# - name: checkout
22+
# uses: actions/checkout@v2
2323

24-
- name: Get version
25-
id: get_version
26-
run: |
27-
echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
24+
# - name: Get version
25+
# id: get_version
26+
# run: |
27+
# echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
2828

29-
- name: Set Environment Variable
30-
run: echo "RELEASE_VERSION=${{ steps.get_version.outputs.VERSION }}" >> $GITHUB_ENV
29+
# - name: Set Environment Variable
30+
# run: echo "RELEASE_VERSION=${{ steps.get_version.outputs.VERSION }}" >> $GITHUB_ENV
3131

32-
# 登录 docker hub
33-
- name: Login to DockerHub
34-
uses: docker/login-action@v1
35-
with:
36-
# GitHub Repo => Settings => Secrets 增加 docker hub 登录密钥信息
37-
# DOCKERHUB_USERNAME 是 docker hub 账号名.
38-
# DOCKERHUB_TOKEN: docker hub => Account Setting => Security 创建.
39-
username: ${{ secrets.DOCKERHUB_USERNAME }}
40-
password: ${{ secrets.DOCKERHUB_TOKEN }}
32+
# # 登录 docker hub
33+
# - name: Login to DockerHub
34+
# uses: docker/login-action@v1
35+
# with:
36+
# # GitHub Repo => Settings => Secrets 增加 docker hub 登录密钥信息
37+
# # DOCKERHUB_USERNAME 是 docker hub 账号名.
38+
# # DOCKERHUB_TOKEN: docker hub => Account Setting => Security 创建.
39+
# username: ${{ secrets.DOCKERHUB_USERNAME }}
40+
# password: ${{ secrets.DOCKERHUB_TOKEN }}
4141

42-
# 构建 backend 并推送到 Docker hub
43-
- name: Set up QEMU
44-
uses: docker/setup-qemu-action@v1
42+
# # 构建 backend 并推送到 Docker hub
43+
# - name: Set up QEMU
44+
# uses: docker/setup-qemu-action@v1
4545

46-
- name: set up Docker Buildx
47-
uses: docker/setup-buildx-action@v3
46+
# - name: set up Docker Buildx
47+
# uses: docker/setup-buildx-action@v3
4848

49-
- name: Build backend arm64 and push
50-
id: docker_build_backend_arm
51-
uses: docker/build-push-action@v2
52-
with:
53-
# backend 的context目录
54-
context: "./src/backend/"
55-
file: ./src/backend/base.Dockerfile
56-
# 是否 docker push
57-
push: true
58-
# docker build arg, 注入 APP_NAME/APP_VERSION
59-
platforms: linux/arm64
60-
build-args: |
61-
APP_NAME="bisheng-backend"
62-
APP_VERSION=${{ steps.get_version.outputs.VERSION }}
63-
PANDOC_ARCH=arm64
64-
# 生成两个 docker tag: ${APP_VERSION} 和 latest
65-
tags: |
66-
${{ env.DOCKERHUB_REPO }}bisheng-backend:${{ steps.get_version.outputs.VERSION }}-arm64
67-
# 获取提交信息
68-
- name: Process git message
69-
id: process_message
70-
run: |
71-
value=$(echo "${{ github.event.head_commit.message }}" | sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/%0A/g')
72-
value=$(echo "${value}" | sed -e ':a' -e 'N' -e '$!ba' -e 's/\r/%0A/g')
73-
echo "message=${value}" >> $GITHUB_ENV
74-
shell: bash
75-
# 飞书通知
76-
- name: notify feishu
77-
uses: fjogeleit/http-request-action@v1
78-
with:
79-
url: ${{ secrets.FEISHU_WEBHOOK }}
80-
method: 'POST'
81-
data: '{"msg_type":"post","content":{"post":{"zh_cn":{"title": "${{ steps.get_version.outputs.VERSION }}发布成功", "content": [[{"tag":"text","text":"基础镜像"},{"tag":"text","text":"${{ env.message }}"}]]}}}}'
49+
# - name: Build backend arm64 and push
50+
# id: docker_build_backend_arm
51+
# uses: docker/build-push-action@v2
52+
# with:
53+
# # backend 的context目录
54+
# context: "./src/backend/"
55+
# file: ./src/backend/base.Dockerfile
56+
# # 是否 docker push
57+
# push: true
58+
# # docker build arg, 注入 APP_NAME/APP_VERSION
59+
# platforms: linux/arm64
60+
# build-args: |
61+
# APP_NAME="bisheng-backend"
62+
# APP_VERSION=${{ steps.get_version.outputs.VERSION }}
63+
# PANDOC_ARCH=arm64
64+
# # 生成两个 docker tag: ${APP_VERSION} 和 latest
65+
# tags: |
66+
# ${{ env.DOCKERHUB_REPO }}bisheng-backend:${{ steps.get_version.outputs.VERSION }}-arm64
67+
# # 获取提交信息
68+
# - name: Process git message
69+
# id: process_message
70+
# run: |
71+
# value=$(echo "${{ github.event.head_commit.message }}" | sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/%0A/g')
72+
# value=$(echo "${value}" | sed -e ':a' -e 'N' -e '$!ba' -e 's/\r/%0A/g')
73+
# echo "message=${value}" >> $GITHUB_ENV
74+
# shell: bash
75+
# # 飞书通知
76+
# - name: notify feishu
77+
# uses: fjogeleit/http-request-action@v1
78+
# with:
79+
# url: ${{ secrets.FEISHU_WEBHOOK }}
80+
# method: 'POST'
81+
# data: '{"msg_type":"post","content":{"post":{"zh_cn":{"title": "${{ steps.get_version.outputs.VERSION }}发布成功", "content": [[{"tag":"text","text":"基础镜像"},{"tag":"text","text":"${{ env.message }}"}]]}}}}'
8282

83-
build_bisheng_amd:
84-
runs-on: ubuntu-latest
85-
steps:
86-
- name: checkout
87-
uses: actions/checkout@v2
83+
# build_bisheng_amd:
84+
# runs-on: ubuntu-latest
85+
# steps:
86+
# - name: checkout
87+
# uses: actions/checkout@v2
8888

89-
- name: Get version
90-
id: get_version
91-
run: |
92-
echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
89+
# - name: Get version
90+
# id: get_version
91+
# run: |
92+
# echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
9393

94-
- name: Set Environment Variable
95-
run: echo "RELEASE_VERSION=${{ steps.get_version.outputs.VERSION }}" >> $GITHUB_ENV
94+
# - name: Set Environment Variable
95+
# run: echo "RELEASE_VERSION=${{ steps.get_version.outputs.VERSION }}" >> $GITHUB_ENV
9696

97-
# 登录 docker hub
98-
- name: Login to DockerHub
99-
uses: docker/login-action@v1
100-
with:
101-
# GitHub Repo => Settings => Secrets 增加 docker hub 登录密钥信息
102-
# DOCKERHUB_USERNAME 是 docker hub 账号名.
103-
# DOCKERHUB_TOKEN: docker hub => Account Setting => Security 创建.
104-
username: ${{ secrets.DOCKERHUB_USERNAME }}
105-
password: ${{ secrets.DOCKERHUB_TOKEN }}
97+
# # 登录 docker hub
98+
# - name: Login to DockerHub
99+
# uses: docker/login-action@v1
100+
# with:
101+
# # GitHub Repo => Settings => Secrets 增加 docker hub 登录密钥信息
102+
# # DOCKERHUB_USERNAME 是 docker hub 账号名.
103+
# # DOCKERHUB_TOKEN: docker hub => Account Setting => Security 创建.
104+
# username: ${{ secrets.DOCKERHUB_USERNAME }}
105+
# password: ${{ secrets.DOCKERHUB_TOKEN }}
106106

107-
- name: Build backend amd64 and push
108-
id: docker_build_backend_amd
109-
uses: docker/build-push-action@v2
110-
with:
111-
# backend 的context目录
112-
context: "./src/backend/"
113-
file: ./src/backend/base.Dockerfile
114-
# 是否 docker push
115-
push: true
116-
# docker build arg, 注入 APP_NAME/APP_VERSION
117-
platforms: linux/amd64
118-
build-args: |
119-
APP_NAME="bisheng-backend"
120-
APP_VERSION=${{ steps.get_version.outputs.VERSION }}
121-
PANDOC_ARCH=amd64
122-
# 生成两个 docker tag: ${APP_VERSION} 和 latest
123-
tags: |
124-
${{ env.DOCKERHUB_REPO }}bisheng-backend:${{ steps.get_version.outputs.VERSION }}-amd64
107+
# - name: Build backend amd64 and push
108+
# id: docker_build_backend_amd
109+
# uses: docker/build-push-action@v2
110+
# with:
111+
# # backend 的context目录
112+
# context: "./src/backend/"
113+
# file: ./src/backend/base.Dockerfile
114+
# # 是否 docker push
115+
# push: true
116+
# # docker build arg, 注入 APP_NAME/APP_VERSION
117+
# platforms: linux/amd64
118+
# build-args: |
119+
# APP_NAME="bisheng-backend"
120+
# APP_VERSION=${{ steps.get_version.outputs.VERSION }}
121+
# PANDOC_ARCH=amd64
122+
# # 生成两个 docker tag: ${APP_VERSION} 和 latest
123+
# tags: |
124+
# ${{ env.DOCKERHUB_REPO }}bisheng-backend:${{ steps.get_version.outputs.VERSION }}-amd64
125125

126126
combine_two_images:
127127
runs-on: ubuntu-latest
@@ -148,5 +148,5 @@ jobs:
148148
password: ${{ secrets.DOCKERHUB_TOKEN }}
149149
- name: Combine Two images
150150
run: |
151-
docker manifest create ${{ env.DOCKERHUB_REPO }}bisheng-backend:${{ steps.get_version.outputs.VERSION }} --amend ${{ env.DOCKERHUB_REPO }}bisheng-backend:${{ steps.get_version.outputs.VERSION }}-arm64 --amend ${{ env.DOCKERHUB_REPO }}bisheng-backend:${{ steps.get_version.outputs.VERSION }}-amd64
151+
docker manifest create ${{ env.DOCKERHUB_REPO }}bisheng-backend:${{ steps.get_version.outputs.VERSION }} ${{ env.DOCKERHUB_REPO }}bisheng-backend:${{ steps.get_version.outputs.VERSION }}-arm64 ${{ env.DOCKERHUB_REPO }}bisheng-backend:${{ steps.get_version.outputs.VERSION }}-amd64
152152
docker manifest push ${{ env.DOCKERHUB_REPO }}bisheng-backend:${{ steps.get_version.outputs.VERSION }}

0 commit comments

Comments
 (0)