Add comprehensive refactoring summary documentation #326
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: imswitch-docker-multiarch-noqt | |
on: | |
push: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
packages: write | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: openuc2/imswitch-noqt | |
CACHE_NAME: openuc2/imswitch-noqt-cache | |
jobs: | |
build-arm64: | |
runs-on: ubuntu-22.04-arm | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
install: true | |
driver: docker-container # Ensures proper driver setup | |
- name: Log in to GitHub container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push ARM64 image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: dockerfile | |
platforms: linux/arm64 | |
push: true | |
tags: | | |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-arm64:latest | |
cache-to: type=registry,mode=max,ref=${{ env.REGISTRY }}/${{ env.CACHE_NAME }}-arm64:cache | |
cache-from: | | |
type=registry,ref=${{ env.REGISTRY }}/${{ env.CACHE_NAME }}-arm64:cache | |
type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-arm64:latest | |
build-args: | | |
BUILD_DATE=${{ github.run_id }} | |
build-amd64: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
install: true | |
driver: docker-container # Ensures proper driver setup | |
- name: Log in to GitHub container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push AMD64 image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: dockerfile | |
platforms: linux/amd64 | |
push: true | |
tags: | | |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-amd64:latest | |
cache-to: type=registry,mode=max,ref=${{ env.REGISTRY }}/${{ env.CACHE_NAME }}-amd64:cache | |
cache-from: | | |
type=registry,ref=${{ env.REGISTRY }}/${{ env.CACHE_NAME }}-amd64:cache | |
type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-amd64:latest | |
build-args: | | |
BUILD_DATE=${{ github.run_id }} | |
create-manifest: | |
needs: [build-amd64, build-arm64] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
install: true | |
- name: Log in to GitHub container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create and push multi-arch manifest | |
run: | | |
docker buildx imagetools create \ | |
--tag $REGISTRY/$IMAGE_NAME:latest \ | |
$REGISTRY/$IMAGE_NAME-amd64:latest \ | |
$REGISTRY/$IMAGE_NAME-arm64:latest |