diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43fc3efa1..4fadf260e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -225,7 +225,7 @@ jobs: # build and push image to docker hub. build-docker-image: - if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/ng-')) + if: github.event_name == 'push' && (github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/ng-')) runs-on: ubuntu-latest needs: [frontend, tests] steps: @@ -233,15 +233,18 @@ jobs: name: Prepare id: prepare run: | - VERSION=edge + IMAGE_NAME=jonaswinkler/paperless-ng if [[ $GITHUB_REF == refs/tags/ng-* ]]; then - VERSION=${GITHUB_REF#refs/tags/ng-} - elif [[ $GITHUB_REF == refs/heads/master ]]; then - VERSION=latest + TAGS=${IMAGE_NAME}:${GITHUB_REF#refs/tags/ng-},${IMAGE_NAME}:latest + INSPECT_TAG=${IMAGE_NAME}:latest elif [[ $GITHUB_REF == refs/heads/* ]]; then - VERSION=${GITHUB_REF#refs/heads/} + TAGS=${IMAGE_NAME}:${GITHUB_REF#refs/heads/} + INSPECT_TAG=${TAGS} + else + exit 1 fi - echo ::set-output name=version::${VERSION} + echo ::set-output name=tags::${TAGS} + echo ::set-output name=inspect_tag::${INSPECT_TAG} - name: Checkout uses: actions/checkout@v2 @@ -279,10 +282,10 @@ jobs: file: ./Dockerfile platforms: linux/amd64,linux/arm/v7,linux/arm64 push: true - tags: jonaswinkler/paperless-ng:${{ steps.prepare.outputs.version }} + tags: ${{ steps.prepare.outputs.tags }} cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache - name: Inspect image run: | - docker buildx imagetools inspect jonaswinkler/paperless-ng:${{ steps.prepare.outputs.version }} + docker buildx imagetools inspect ${{ steps.prepare.outputs.inspect_tag }}