mirror of
https://github.com/katanemo/plano.git
synced 2026-07-11 16:12:13 +02:00
add release docker publish
This commit is contained in:
parent
2e2680c98c
commit
db9eb446d4
2 changed files with 88 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
name: Publish Docker image
|
name: Publish docker image (latest)
|
||||||
|
|
||||||
env:
|
env:
|
||||||
DOCKER_IMAGE: katanemo/archgw
|
DOCKER_IMAGE: katanemo/archgw
|
||||||
87
.github/workflows/docker-push-release.yml
vendored
Normal file
87
.github/workflows/docker-push-release.yml
vendored
Normal file
|
|
@ -0,0 +1,87 @@
|
||||||
|
name: Publish docker image (release)
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
# Build ARM64 image on native ARM64 runner
|
||||||
|
build-arm64:
|
||||||
|
runs-on: [linux-arm64]
|
||||||
|
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: ${{ env.DOCKER_IMAGE }}
|
||||||
|
|
||||||
|
- name: Build and Push ARM64 Image
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./arch/Dockerfile
|
||||||
|
platforms: linux/arm64
|
||||||
|
push: true
|
||||||
|
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: ${{ env.DOCKER_IMAGE }}
|
||||||
|
|
||||||
|
- 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: ${{ env.DOCKER_IMAGE }}
|
||||||
|
|
||||||
|
- name: Create Multi-Arch Manifest
|
||||||
|
run: |
|
||||||
|
# Combine the architecture-specific images into a single manifest
|
||||||
|
docker buildx imagetools create -t ${{ steps.meta.outputs.tags }} \
|
||||||
|
${{ env.DOCKER_IMAGE }}:arm64 \
|
||||||
|
${{ env.DOCKER_IMAGE }}:amd64
|
||||||
Loading…
Add table
Add a link
Reference in a new issue