mirror of
https://github.com/katanemo/plano.git
synced 2026-06-17 15:25:17 +02:00
multi build
This commit is contained in:
parent
399e77d873
commit
64869d05d6
1 changed files with 114 additions and 31 deletions
145
.github/workflows/docker-push.yml
vendored
145
.github/workflows/docker-push.yml
vendored
|
|
@ -11,27 +11,66 @@ on:
|
|||
# release:
|
||||
# types: [published]
|
||||
|
||||
# jobs:
|
||||
|
||||
# release:
|
||||
# name: Push Docker image to Docker Hub
|
||||
# runs-on: ${{ matrix.builder }}
|
||||
# permissions:
|
||||
# packages: write
|
||||
# contents: read
|
||||
# attestations: write
|
||||
# id-token: write
|
||||
|
||||
# strategy:
|
||||
# matrix:
|
||||
# include:
|
||||
# - builder: ubuntu-latest
|
||||
# platform: linux/amd64
|
||||
# # - builder: linux-arm64
|
||||
# # platform: linux/arm64
|
||||
|
||||
# steps:
|
||||
# - name: Check out the repo
|
||||
# uses: actions/checkout@v4
|
||||
|
||||
# - name: Log in to Docker Hub
|
||||
# uses: docker/login-action@v3
|
||||
# with:
|
||||
# username: ${{ secrets.DOCKER_USERNAME }}
|
||||
# password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
# - name: Extract metadata (tags, labels) for Docker
|
||||
# id: meta
|
||||
# uses: docker/metadata-action@v5
|
||||
# with:
|
||||
# images: katanemo/archgw-test
|
||||
|
||||
# - name: Set up QEMU
|
||||
# uses: docker/setup-qemu-action@v3
|
||||
|
||||
# - name: Set up Docker Buildx
|
||||
# uses: docker/setup-buildx-action@v3
|
||||
|
||||
# - name: Build and push Docker image
|
||||
# id: push
|
||||
# uses: docker/build-push-action@v6
|
||||
# with:
|
||||
# context: .
|
||||
# platforms: linux/amd64, linux/arm64
|
||||
# file: ./arch/Dockerfile
|
||||
# push: true
|
||||
# tags: ${{ steps.meta.outputs.tags }}
|
||||
# labels: ${{ steps.meta.outputs.labels }}
|
||||
|
||||
|
||||
|
||||
jobs:
|
||||
|
||||
release:
|
||||
name: Push Docker image to Docker Hub
|
||||
runs-on: ${{ matrix.builder }}
|
||||
permissions:
|
||||
packages: write
|
||||
contents: read
|
||||
attestations: write
|
||||
id-token: write
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- builder: ubuntu-latest
|
||||
platform: linux/amd64
|
||||
# - builder: linux-arm64
|
||||
# platform: linux/arm64
|
||||
|
||||
# Build ARM64 image on native ARM64 runner
|
||||
build-arm64:
|
||||
runs-on: [linux-arm64, arm64]
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
|
|
@ -46,19 +85,63 @@ jobs:
|
|||
with:
|
||||
images: katanemo/archgw-test
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build and push Docker image
|
||||
id: push
|
||||
uses: docker/build-push-action@v6
|
||||
- name: Build and Push ARM64 Image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64, linux/arm64
|
||||
file: ./arch/Dockerfile
|
||||
platforms: linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
tags: ${{ steps.meta.outputs.tags }}-arm64
|
||||
|
||||
# Build AMD64 image on GitHub's AMD64 runner
|
||||
build-amd64:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: katanemo/archgw-test
|
||||
|
||||
- name: Build and Push AMD64 Image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: ./arch/Dockerfile
|
||||
platforms: linux/amd64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}-amd64
|
||||
|
||||
# Combine ARM64 and AMD64 images into a multi-arch manifest
|
||||
create-manifest:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build-arm64, build-amd64] # Wait for both builds
|
||||
steps:
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: katanemo/archgw-test
|
||||
|
||||
- name: Create Multi-Arch Manifest
|
||||
run: |
|
||||
# Use Docker Buildx to combine the images
|
||||
docker buildx imagetools create -t ${{ steps.meta.outputs.tags }} \
|
||||
${{ steps.meta.outputs.tags }}-arm64 \
|
||||
${{ steps.meta.outputs.tags }}-amd64
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue