Skip to content

Commit 495a5f5

Browse files
author
jorbenzhu
committed
增加流水线创建各arch下的docker镜像
1 parent 79c463f commit 495a5f5

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Create and publish Multi-platform image
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
build-and-push-image-to-dockerhub:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
- name: Set up QEMU
15+
uses: docker/setup-qemu-action@v3
16+
- name: Set up Docker Buildx
17+
uses: docker/setup-buildx-action@v3
18+
- name: Login to Docker Hub
19+
uses: docker/login-action@v3
20+
with:
21+
username: ${{ secrets.DOCKERHUB_USERNAME }}
22+
password: ${{ secrets.DOCKERHUB_TOKEN }}
23+
- name: Build and push
24+
uses: docker/build-push-action@v5
25+
with:
26+
context: .
27+
platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7,linux/386
28+
push: true
29+
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}:${{ github.ref_name }}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Create the latest version
2+
3+
on:
4+
release:
5+
types: [ published ]
6+
7+
jobs:
8+
build-and-push-image-to-dockerhub:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
- name: Set up QEMU
14+
uses: docker/setup-qemu-action@v3
15+
- name: Set up Docker Buildx
16+
uses: docker/setup-buildx-action@v3
17+
- name: Login to Docker Hub
18+
uses: docker/login-action@v3
19+
with:
20+
username: ${{ secrets.DOCKERHUB_USERNAME }}
21+
password: ${{ secrets.DOCKERHUB_TOKEN }}
22+
- name: Build and push
23+
uses: docker/build-push-action@v5
24+
with:
25+
context: .
26+
platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7,linux/386
27+
push: true
28+
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}:latest

0 commit comments

Comments
 (0)