Commit 9edb2e68 authored by Dmitriy Safronov's avatar Dmitriy Safronov
Browse files

ci: npmrc

parent 92a63a03
Loading
Loading
Loading
Loading
+16 −4
Original line number Diff line number Diff line
@@ -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=${{ secrets.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