diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 72aa091..26bbb32 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -56,10 +56,16 @@ jobs: - name: Install cosign uses: sigstore/cosign-installer@main + - name: Write signing key to disk + run: 'echo "$KEY" > cosign.key' + shell: bash + env: + KEY: ${{ secrets.COSIGN_PRIVATE_KEY }} + - name: Sign the container image env: COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }} - run: cosign sign --yes ghcr.io/aneisch/${{ env.IMAGE_NAME }}@${{ steps.push-step.outputs.digest }} + run: cosign sign --key cosign.key ghcr.io/aneisch/${{ env.IMAGE_NAME }}@${{ steps.push-step.outputs.digest }} Multiarch: runs-on: ubuntu-latest @@ -94,6 +100,12 @@ jobs: platforms: linux/arm64/v8 cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Write signing key to disk + run: 'echo "$KEY" > cosign.key' + shell: bash + env: + KEY: ${{ secrets.COSIGN_PRIVATE_KEY }} - name: Install cosign uses: sigstore/cosign-installer@main @@ -101,4 +113,4 @@ jobs: - name: Sign the container image env: COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }} - run: cosign sign --yes ghcr.io/aneisch/${{ env.IMAGE_NAME }}@${{ steps.push-step.outputs.digest }} + run: cosign sign ghcr.io/aneisch/${{ env.IMAGE_NAME }}@${{ steps.push-step.outputs.digest }}