diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 776876bafc722c2adfa118b48e081347740fe380..b825455503232250e5e2acc5629fa33c9a575089 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -39,10 +39,9 @@ jobs: - name: Setup Docker buildx uses: docker/setup-buildx-action@v3 - # Login against a Docker registry except on PR + # Login against a Docker registry # https://github.com/docker/login-action - name: Log into registry ${{ env.REGISTRY }} - # if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} @@ -77,14 +76,18 @@ jobs: restore-keys: | ${{ runner.os }}-multi-buildx - # Build and push Docker image with Buildx (don't push on PR) + # .npmrc + - name: Create .npmrc + run: | + echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc + + # Build and push Docker image with Buildx # https://github.com/docker/build-push-action - name: Build and push Docker image id: build-and-push uses: docker/build-push-action@v6 with: context: . - # push: ${{ github.event_name != 'pull_request' }} push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} @@ -93,6 +96,14 @@ jobs: # More: https://github.com/moby/buildkit#--export-cache-options # And: https://github.com/docker/buildx#--cache-tonametypetypekeyvalue cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new + # + secret-files: | + npmrc=.npmrc + + # .npmrc + - name: Delete .npmrc + run: | + rm -f .npmrc # Temp fix / Disabled on self-hosted runner # https://github.com/docker/build-push-action/issues/252 @@ -102,6 +113,7 @@ jobs: rm -rf /tmp/.buildx-cache mv /tmp/.buildx-cache-new /tmp/.buildx-cache + # * SIGNING ############################################################################################### # Install the cosign tool except on PR # https://github.com/sigstore/cosign-installer