diff --git a/.github/workflows/nightly-docker-build.yaml b/.github/workflows/nightly-docker-build.yaml index d9818390d2..7ecddc4dae 100644 --- a/.github/workflows/nightly-docker-build.yaml +++ b/.github/workflows/nightly-docker-build.yaml @@ -57,6 +57,7 @@ jobs: - name: Build and push uses: docker/build-push-action@v2 + id: build-and-push with: context: . file: ./Dockerfile-offline @@ -73,14 +74,28 @@ jobs: - name: Get signing key run: echo "${{ secrets.SIGNING_SECRET }}" > cosign.key - - name: Container Signing + # - name: Container Signing + # run: | + # cosign sign --key cosign.key \ + # -a "repo=${{ github.repository }}" \ + # -a "workflow=${{ github.workflow }}" \ + # -a "ref=${{ github.sha }}" \ + # -a "owner=Spectro Cloud" \ + # ${{ steps.meta.outputs.tags }} + # env: + # COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }} + + - name: Sign image with a key run: | - cosign sign --key cosign.key \ - -a "repo=${{ github.repository }}" \ - -a "workflow=${{ github.workflow }}" \ - -a "ref=${{ github.sha }}" \ - -a "owner=Spectro Cloud" \ - ${{ steps.meta.outputs.tags }} + cosign sign --yes \ + -a "repo=${{ github.repository }}" \ + -a "workflow=${{ github.workflow }}" \ + -a "ref=${{ github.sha }}" \ + -a "owner=Spectro Cloud" \ + --key env://COSIGN_PRIVATE_KEY "${TAGS}@${DIGEST}" \ env: + TAGS: ${{ steps.docker_meta.outputs.tags }} + COSIGN_PRIVATE_KEY: ${{ secrets.SIGNING_SECRET }} COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }} + DIGEST: ${{ steps.build-and-push.outputs.digest }}