From 141315cf427ae21fb6bc9e1479bda1c74bd8ba1c Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Sat, 9 Jan 2021 22:38:05 +0100 Subject: [PATCH] Revert "try separate build / push" This reverts commit 6fa0d00b --- .github/workflows/ci.yml | 45 +++++++++++----------------------------- 1 file changed, 12 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 78dd931d0..3fe9a6ad3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,7 +84,9 @@ jobs: # build and push image to docker hub. build-docker-image: + if: github.event_name == 'push' && (github.ref == 'refs/heads/travis-multiarch-builds' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' || github.ref == 'refs/tags/ng-*') runs-on: ubuntu-latest + needs: tests steps: - name: Prepare @@ -116,10 +118,19 @@ jobs: restore-keys: | ${{ runner.os }}-buildx- - - name: Build image + name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - + name: Build and push uses: docker/build-push-action@v2 with: + context: . + file: ./Dockerfile platforms: linux/amd64,linux/arm/v7 + push: true tags: jonaswinkler/paperless-ng:${{ steps.prepare.outputs.version }} cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache @@ -127,35 +138,3 @@ jobs: name: Inspect image run: | docker buildx imagetools inspect jonaswinkler/paperless-ng:${{ steps.prepare.outputs.version }} - - push-docker-image: - runs-on: ubuntu-latest - if: github.event_name == 'push' && (github.ref == 'refs/heads/travis-multiarch-builds' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' || github.ref == 'refs/tags/ng-*') - needs: [tests, build-docker-image] - - steps: - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - - name: Cache Docker layers - uses: pat-s/always-upload-cache@v2.1.3 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Push image - uses: docker/build-push-action@v2 - with: - platforms: linux/amd64,linux/arm/v7 - tags: jonaswinkler/paperless-ng:${{ steps.prepare.outputs.version }} - cache-from: type=local,src=/tmp/.buildx-cache - push: true