# Build amd64 and arm64 images on native runners, then merge them into # multi-platform Docker manifests. name: Build Docker Image alpine (native + manifest) on: # Allow manual dispatch workflow_dispatch: # Cancel previous runs when a new one is triggered concurrency: group: docker-build-alpine cancel-in-progress: true jobs: build: name: Build ${{ matrix.platform }} strategy: matrix: include: - platform: linux/amd64 runner: ubuntu-26.04 suffix: amd64 - platform: linux/arm64 runner: ubuntu-26.04-arm suffix: arm64 runs-on: ${{ matrix.runner }} steps: - name: Checkout code uses: actions/checkout@v7 - name: Setup Node.js 24.x uses: actions/setup-node@v7 with: node-version: '24.x' cache: npm - name: Verify Node.js version run: node -v - name: Verify Npm version run: npm -v - name: Set metadata id: meta run: | VERSION=$(jq -r '.version' package.json) echo "VERSION=$VERSION" >> $GITHUB_OUTPUT echo "VCS_REF=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT - name: Write build metadata to .dockerbuild.json run: | cat > .dockerbuild.json <> $GITHUB_OUTPUT - name: Log in to Docker Hub uses: docker/login-action@v4 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Create and push manifests for version ${{ steps.meta.outputs.VERSION }} env: AMD64_IMAGE: luligu/matterbridge:alpine-${{ github.run_id }}-${{ github.run_attempt }}-amd64 ARM64_IMAGE: luligu/matterbridge:alpine-${{ github.run_id }}-${{ github.run_attempt }}-arm64 run: | docker manifest create luligu/matterbridge:alpine \ $AMD64_IMAGE \ $ARM64_IMAGE docker manifest push luligu/matterbridge:alpine docker manifest create luligu/matterbridge:alpine-${{ steps.meta.outputs.VERSION }} \ $AMD64_IMAGE \ $ARM64_IMAGE docker manifest push luligu/matterbridge:alpine-${{ steps.meta.outputs.VERSION }} docker manifest inspect luligu/matterbridge:alpine