diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 6398e78..8361404 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -22,9 +22,15 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - - name: Log into registry - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin - - name: Build & Push image + - name: Login to registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Determine images to publish + id: image-tags run: | IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME @@ -40,13 +46,18 @@ jobs: # Use Docker `latest` tag convention [ "$VERSION" == "master" ] && VERSION=latest - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - - docker buildx build \ - --push \ - --tag $IMAGE_ID:$VERSION \ - --platform linux/arm/v7 \ - --platform linux/arm64 \ - --platform linux/amd64 \ - . + IMAGES= + IMAGES="$IMAGE_ID:$VERSION"$'\n'$IMAGES + + # debug output + echo images $IMAGES + echo ::set-output name=images::"$IMAGES" + + - name: Build and push + uses: docker/build-push-action@v2 + if: ${{ steps.image-tags.outputs.images }} + with: + context: . + platforms: linux/amd64,linux/arm/v7,linux/arm64 + push: true + tags: ${{ steps.image-tags.outputs.images }}