From 2c149d7a85b8e8b649a20ca277ba6f8f8ac065d0 Mon Sep 17 00:00:00 2001 From: ender Date: Sat, 30 Mar 2024 22:42:57 +0100 Subject: [PATCH] fix workflows --- .github/workflows/docker-publish.yml | 28 ++++++++++++++++------------ .github/workflows/node.js.yml | 23 ++++++++++------------- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 3174b98..ceaf216 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -41,17 +41,19 @@ jobs: # https://github.com/sigstore/cosign-installer - name: Install cosign if: github.event_name != 'pull_request' - uses: sigstore/cosign-installer@v3.0.5 + uses: sigstore/cosign-installer@6e04d228eb30da1757ee4e1dd75a0ec73a653e06 #v3.1.1 with: - cosign-release: 'v1.13.1' + cosign-release: 'v2.1.1' - # Workaround: https://github.com/docker/build-push-action/issues/461 - - name: Setup Docker buildx - uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf + # Set up BuildKit Docker container builder to be able to build + # multi-platform images and export cache + # https://github.com/docker/setup-buildx-action + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 - name: Load secret id: op-load-secret - uses: 1password/load-secrets-action@v1.2.0 + uses: 1password/load-secrets-action@v2 with: export-env: true env: @@ -62,7 +64,7 @@ jobs: # https://github.com/docker/login-action - name: Log into registry ${{ env.REGISTRY }} if: github.event_name != 'pull_request' - uses: docker/login-action@v2.1.0 + uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -72,7 +74,7 @@ jobs: # https://github.com/docker/metadata-action - name: Extract Docker metadata id: meta - uses: docker/metadata-action@v4.4.0 + uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | @@ -89,7 +91,7 @@ jobs: # https://github.com/docker/build-push-action - name: Build and push Docker image id: build-and-push - uses: docker/build-push-action@v4.0.0 + uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0 with: context: . push: ${{ github.event_name != 'pull_request' }} @@ -106,10 +108,12 @@ jobs: - name: Sign the published Docker image if: ${{ github.event_name != 'pull_request' }} env: - COSIGN_EXPERIMENTAL: 'true' + # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable + TAGS: ${{ steps.meta.outputs.tags }} + DIGEST: ${{ steps.build-and-push.outputs.digest }} # This step uses the identity token to provision an ephemeral certificate # against the sigstore community Fulcio instance. - run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }} + run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} deploy: runs-on: ubuntu-latest needs: build @@ -135,7 +139,7 @@ jobs: - name: Load secret id: op-load-secret - uses: 1password/load-secrets-action@v1.2.0 + uses: 1password/load-secrets-action@v2 with: export-env: true env: diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 790a194..1c43e50 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -11,20 +11,17 @@ on: jobs: build: - runs-on: ubuntu-latest - strategy: matrix: - node-version: [20.x, 22.x, 24.x] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - + node: [ latest, current ] + name: Node ${{ matrix.node }} sample steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - run: yarn --frozen-lockfile - - run: yarn build - # - run: yarn test + - uses: actions/checkout@v4 + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + - run: yarn --frozen-lockfile + - run: yarn build + # - run: yarn test