# Based on https://github.com/ajayyy/sb-mirror/blob/main/.github/workflows/docker-build.yml name: multi-build-docker on: workflow_call: inputs: name: required: true type: string username: required: true type: string folder: required: true type: string secrets: GH_TOKEN: required: true jobs: build_container: runs-on: ubuntu-latest permissions: packages: write steps: - uses: actions/checkout@v4 - name: Docker meta id: meta uses: docker/metadata-action@v5 with: images: | ghcr.io/${{ inputs.username }}/${{ inputs.name }} tags: | type-raw,value=alpine flavor: | latest=true - name: Login to GHCR uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GH_TOKEN }} - name: Set up QEMU uses: docker/setup-qemu-action@v3 with: platforms: arm,arm64 - name: Set up buildx uses: docker/setup-buildx-action@v3 - name: push uses: docker/build-push-action@v6 with: context: ${{ inputs.folder }} platforms: linux/amd64,linux/arm64 push: true tags: ${{ steps.meta.outputs.tags }}