Skip to content

Build ArchLinuxARM Image #10

Build ArchLinuxARM Image

Build ArchLinuxARM Image #10

name: Build ArchLinuxARM Image
on:
workflow_dispatch:
permissions:
contents: read
packages: write
jobs:
build-and-push:
name: Build and Push GHCR Image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU (arm emulation)
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set shared Docker config
run: echo "DOCKER_CONFIG=$RUNNER_TEMP/.docker" >> "$GITHUB_ENV"
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare rootfs (aarch64)
env:
TARGET_ARCH: linux/arm64
run: |
set -euxo pipefail
# Simple placeholder for testing the build step
mkdir -p "${TARGET_ARCH}"
touch "${TARGET_ARCH}/.placeholder"
- name: Prepare rootfs (armv7h)
env:
TARGET_ARCH: linux/arm/v7
run: |
set -euxo pipefail
# Simple placeholder for testing the build step
mkdir -p "${TARGET_ARCH}"
touch "${TARGET_ARCH}/.placeholder"
- name: Build and push multi-arch image
env:
IMAGE: ghcr.io/${{ github.repository_owner }}/docker-archlinuxarm
run: |
set -euxo pipefail
sudo --preserve-env=DOCKER_CONFIG docker buildx build --platform linux/arm64,linux/arm/v7 . -t $IMAGE:${DATE_TAG} --push
# Inspect the pushed image to verify both platforms are present
sudo --preserve-env=DOCKER_CONFIG docker buildx imagetools inspect "$IMAGE:${DATE_TAG}"