From c3ec1ce20d4cd8b3f1c7c06675e29282b59f821d Mon Sep 17 00:00:00 2001 From: Isaac Date: Mon, 5 Jun 2023 16:54:02 +0100 Subject: [PATCH] build(docker): multi-platform, any branch --- .github/workflows/docker.yml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 2244b3b..f2e2712 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -2,10 +2,10 @@ name: Publish Docker image on: push: - branches: - - 'main' - tags: - - 'v*' + # branches: + # - 'main' + # tags: + # - 'v*' pull_request: branches: - 'main' @@ -20,14 +20,20 @@ jobs: steps: - name: Check out the repo uses: actions/checkout@v3 - + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Log in to Docker Hub if: github.event_name != 'pull_request' uses: docker/login-action@v2 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_TOKEN }} - + - name: Log in to the Container registry if: github.event_name != 'pull_request' uses: docker/login-action@v2 @@ -35,7 +41,7 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - + - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@v4 @@ -48,11 +54,12 @@ jobs: type=ref,event=pr type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} - + - name: Build and push Docker images uses: docker/build-push-action@v4 with: context: . + platforms: linux/amd64,linux/arm64 push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + labels: ${{ steps.meta.outputs.labels }}