From 8850d6ad342eb4d81f6ecd01ab82eda9bc035825 Mon Sep 17 00:00:00 2001 From: Nobix <92090462+nobixX@users.noreply.github.com> Date: Fri, 8 Apr 2022 07:02:48 +0530 Subject: [PATCH] Update docker.yml --- .github/workflows/docker.yml | 39 ++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 6f1f62ef..3f777499 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -106,30 +106,33 @@ jobs: uses: docker/setup-buildx-action@v1 - name: Login to DockerHub - if: ${{ inputs.dockerhub-enable }} + if: $${{ github.event_name != 'pull_request' }} uses: docker/login-action@v1 with: username: ${{ inputs.dockerhub-username }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Login to GHCR + if: ${{ github.event_name != 'pull_request' }} uses: docker/login-action@v1 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GHCR_PAT }} - - - name: Docker meta - id: docker_meta - uses: docker/metadata-action@v3.6.2 - with: - # list of Docker images to use as base name for tags - images: ${{ inputs.image-names }} - flavor: | - latest=false - tags: | - type=raw,value=latest +# - +# name: Docker meta +# id: docker_meta +# uses: docker/metadata-action@v3.6.2 +# with: +# # list of Docker images to use as base name for tags +# images: ${{ inputs.image-names }} +# flavor: | +# latest=false +# tags: | +# type=raw,value=latest + + - # this will build the images, once per platform, # then push to both Docker Hub and GHCR @@ -137,19 +140,17 @@ jobs: id: docker_build_and_push uses: docker/build-push-action@v2 with: - platforms: ${{ inputs.platforms }} - context: ${{ inputs.context }} - target: ${{ inputs.target }} - file: ${{ inputs.file }} + platforms: linux/amd64 + context: app builder: ${{ steps.buildx.outputs.name }} # it uses github cache API for faster builds: # https://github.com/crazy-max/docker-build-push-action/blob/master/docs/advanced/cache.md#cache-backend-api cache-from: type=gha cache-to: type=gha,mode=max # for an approved pull_request, only push pr-specific tags - push: ${{ inputs.dockerhub-enable }} - tags: ${{ steps.docker_meta.outputs.tags }} - labels: ${{ steps.docker_meta.outputs.labels }} + push: ${{ github.event_name != 'pull_request' }} + tags: buzzerburger/test:latest +# labels: ${{ steps.docker_meta.outputs.labels }} - name: Show image digest run: echo ${{ steps.docker_build_and_push.outputs.digest }}