fix: add registry login (#476)

## This PR

Fixes container signing release step [1]. This step was missing the
registry login step, hence signature push failed.


[1] -
https://github.com/open-feature/flagd/actions/runs/4357163255/jobs/7616231967

---------

Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>
This commit is contained in:
Kavindu Dodanduwa 2023-03-09 08:06:19 -08:00 committed by GitHub
parent f9adc8e374
commit 99de755749
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -86,12 +86,19 @@ jobs:
runs-on: ubuntu-latest
if: ${{ needs.release-please.outputs.release_created }}
steps:
- name: Log in to the Container registry
uses: docker/login-action@ec9cdf07d570632daeb912f5b2099cb9ec1d01e6
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Install Cosign
uses: sigstore/cosign-installer@bd2d1189b064bcddc3903176a807dcdba72d7fd0
- name: Sign the image
run: |
cosign sign --yes --key env://COSIGN_PRIVATE_KEY ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ needs.container-release.outputs.image_digest }}
cosign sign --yes --key env://COSIGN_PRIVATE_KEY ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ needs.container-release.outputs.digest }}
cosign public-key --key env://COSIGN_PRIVATE_KEY --outfile ${{ env.PUBLIC_KEY_FILE }}
env:
COSIGN_PRIVATE_KEY: ${{secrets.COSIGN_PRIVATE_KEY}}