From 2862d9cd3c0201ffb05c2350bea4e3676ce37579 Mon Sep 17 00:00:00 2001 From: richardrobertreitz Date: Sat, 15 Mar 2025 06:25:26 +0000 Subject: [PATCH] Update .github/workflows/build-and-push.yaml --- .github/workflows/build-and-push.yaml | 52 +++++++++++++++++---------- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build-and-push.yaml b/.github/workflows/build-and-push.yaml index decb3c6..72f9612 100644 --- a/.github/workflows/build-and-push.yaml +++ b/.github/workflows/build-and-push.yaml @@ -1,37 +1,51 @@ -name: Create and publish a Docker image +name: ci on: push jobs: - docker: - runs-on: docker - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: recursive + build: + runs-on: ubuntu-22.04 - - name: Repository meta + steps: + - + name: Repository meta id: repository run: | registry=${{ github.server_url }} registry=${registry##http*://} echo "registry=${registry}" >> "$GITHUB_OUTPUT" + echo "registry=${registry}" repository="$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')" echo "repository=${repository}" >> "$GITHUB_OUTPUT" - - - name: Docker meta + echo "repository=${repository}" + - + name: Docker meta uses: docker/metadata-action@v5 id: docker with: images: ${{ steps.repository.outputs.registry }}/${{ steps.repository.outputs.repository }} - - - name: Build and push - uses: https://codeberg.org/umglurf/kaniko-action@main + - + name: Login to registry + uses: docker/login-action@v3 + with: + registry: ${{ steps.repository.outputs.registry }} + username: ${{ github.repository }} + password: ${{ secrets.PACKAGES_TOKEN }} + - + name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + buildkitd-flags: '--allow-insecure-entitlement network.host' + driver-opts: network=host + - + name: Build and push + uses: docker/build-push-action@v6 with: - credentials: | - ${{ steps.repository.outputs.registry }}=${{ github.repository }}:${{ secrets.PACKAGES_TOKEN }} - destinations: | - ${{ steps.docker.outputs.tags }} push: true + allow: network.host + network: host + platforms: linux/amd64,linux/arm64 + tags: ${{ steps.docker.outputs.tags }}