Skip to content

Commit

Permalink
测试分别创建不同架构
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyiming748 committed Jul 2, 2024
1 parent 0d9d66b commit 1dba3bb
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Docker Image
name: Publish amd64 Docker Image

on:
push:
Expand All @@ -8,16 +8,11 @@ on:
jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
matrix:
platform: [ linux/amd64, linux/arm64 ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: ${{ matrix.platform }}
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
Expand All @@ -28,14 +23,10 @@ jobs:
uses: docker/metadata-action@v5
with:
images: zhangyiming748/convert_images
tags: |
type=semver,pattern={{version}}
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ matrix.platform }}
tags: ${{ steps.meta.outputs.tags }}-amd64
labels: ${{ steps.meta.outputs.labels }}
32 changes: 32 additions & 0 deletions .github/workflows/docker_push_arm64_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publish amd64 Docker Image

on:
push:
tags:
- 'v*'

jobs:
build-and-push:
runs-on: arm64-linux
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: zhangyiming748/convert_images
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}-arm64
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 1dba3bb

Please sign in to comment.