Skip to content

Commit ec04c3d

Browse files
committed
chore(workflow): 修改基础镜像发布为手动触发- 将工作流名称从自动发布更新为手动触发
- 添加 Release-DongTai-Infra-Service 任务 - 配置 Docker Buildx 构建环境- 实现多平台镜像构建与推送(linux/amd64)- 增加 Logstash、Logrotate 和 Redis 镜像构建步骤 - 添加构建开始和完成的通知机制 - 使用 GitHub Secrets 管理 Docker Registry 认证信息 - 支持版本标签和 latest 标签同时推送
1 parent 79d0934 commit ec04c3d

1 file changed

Lines changed: 74 additions & 1 deletion

File tree

.github/workflows/manual_base_image.yaml

Lines changed: 74 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release DongTai IAST Base Image
1+
name: Manual DongTai IAST Base Image
22

33
on:
44
workflow_dispatch: # ✅ 改为手动触发
@@ -9,6 +9,79 @@ on:
99
default: 'v1.17.7'
1010

1111
jobs:
12+
Release-DongTai-Infra-Service:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
max-parallel: 4
16+
steps:
17+
- name: start-build
18+
uses: joelwmale/webhook-action@master
19+
with:
20+
url: ${{ secrets.WEBHOOK_URL }}
21+
body: '{"msg_type": "interactive","card": {"config": {"wide_screen_mode": true,"enable_forward": true},"elements": [{"tag": "div","text": {"content": "状态:构建开始\n项目:${{github.repository}}\n分支:${{github.ref}}\n流程:${{github.workflow}}\n构建编号:${{github.run_number}}\n触发事件:${{github.event_name}}\n提交人:${{github.actor}}\n","tag": "lark_md"}}]}}'
22+
23+
- name: Checkout
24+
uses: actions/checkout@v3
25+
- name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@v2
27+
28+
- name: Login to DockerHub
29+
uses: docker/login-action@v1
30+
with:
31+
username: ${{ secrets.DONGTAI_DOCKERHUB_USERNAME }}
32+
password: ${{ secrets.DONGTAI_DOCKERHUB_TOKEN }}
33+
34+
- name: Login to AliyunRegistry
35+
uses: docker/login-action@v1
36+
with:
37+
registry: ${{ secrets.ALIYUN_REGISTRY }}
38+
username: ${{ secrets.ALIYUN_DOCKERHUB_USER }}
39+
password: ${{ secrets.ALIYUN_DOCKERHUB_PASSWORD }}
40+
41+
- id: release
42+
run: |
43+
TAG_NAME=${{ github.event.inputs.version }} # ✅ 使用手动输入的版本号
44+
ID=`echo ${TAG_NAME##v}`
45+
echo "::set-output name=version::$ID"
46+
47+
- name: Build and push logstash
48+
uses: docker/build-push-action@v3
49+
with:
50+
context: ./logstash
51+
file: ./logstash/Dockerfile
52+
push: true
53+
platforms: linux/amd64
54+
tags: |
55+
dongtai/dongtai-logstash:${{ steps.release.outputs.version }}
56+
dongtai/dongtai-logstash:latest
57+
58+
- name: Build and push logrotate
59+
uses: docker/build-push-action@v3
60+
with:
61+
context: ./logrotate
62+
file: ./logrotate/Dockerfile
63+
push: true
64+
platforms: linux/amd64
65+
tags: |
66+
dongtai/dongtai-logrotate:${{ steps.release.outputs.version }}
67+
dongtai/dongtai-logrotate:latest
68+
69+
- name: Build and push Redis
70+
uses: docker/build-push-action@v2
71+
with:
72+
context: ./redis
73+
push: true
74+
platforms: linux/amd64
75+
tags: |
76+
dongtai/dongtai-redis:${{ steps.release.outputs.version }}
77+
dongtai/dongtai-redis:latest
78+
79+
- name: finish build
80+
uses: joelwmale/webhook-action@master
81+
with:
82+
url: ${{ secrets.WEBHOOK_URL }}
83+
body: '{"msg_type": "interactive","card": {"config": {"wide_screen_mode": true,"enable_forward": true},"elements": [{"tag": "div","text": {"content": "状态:构建完成\n项目:${{github.repository}}\n分支:${{github.ref}}\n流程:${{github.workflow}}\n构建编号:${{github.run_number}}\n触发事件:${{github.event_name}}\n提交人:${{github.actor}}\nSHA-1:${{github.sha}}\n","tag": "lark_md"}}]}}'
84+
1285
dongtai-mysql:
1386
name: dongtai-mysql
1487
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)