diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c98c24fc..4da67b56 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,10 +1,8 @@ name: Create and publish a api image -on: - push: - tags: - - v** +on: push + env: REGISTRY: ghcr.io/metal-toolbox API_IMAGE_NAME: audito-maldito/audito-maldito @@ -41,6 +39,8 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - uses: sigstore/cosign-installer@main + - name: Get current date id: date run: echo "::set-output name=date::$(date -u +'%Y-%m-%dT%H:%M:%SZ')" @@ -52,6 +52,7 @@ jobs: images: ${{ env.REGISTRY }}/${{ env.API_IMAGE_NAME }} - name: Build rsyslog and push Docker image + id: rsyslog-build-push uses: docker/build-push-action@fdf7f43ecf7c1a5c7afe936410233728a8c2d9c2 with: context: "./contrib/rsyslog" @@ -60,10 +61,19 @@ jobs: tags: ${{ env.REGISTRY }}/${{ env.API_IMAGE_NAME }}:${{ github.ref_name }}-rsyslog labels: ${{ steps.meta-api.outputs.labels }} + - run: cosign sign -y -r ${TAGS} + env: + TAGS: ${{ needs.rsyslog-build-push.outputs.digest }} + - name: Build and push Docker image + id: am-build-push uses: docker/build-push-action@fdf7f43ecf7c1a5c7afe936410233728a8c2d9c2 with: push: true file: Dockerfile tags: ${{ env.REGISTRY }}/${{ env.API_IMAGE_NAME }}:${{ github.ref_name }} - labels: ${{ steps.meta-api.outputs.labels }} \ No newline at end of file + labels: ${{ steps.meta-api.outputs.labels }} + + - run: cosign sign -y -r ${TAGS} + env: + TAGS: ${{ needs.am-build-push.outputs.digest }}