ci(release): bump cosign version #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Cosign | |
uses: sigstore/[email protected] | |
with: | |
cosign-release: 'v2.2.3' | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Extract Version | |
id: tagger | |
uses: battila7/get-version-action@v2 | |
- name: Print Version | |
run: | | |
echo ${{steps.tagger.outputs.version}} | |
echo ${{steps.tagger.outputs.version-without-v}} | |
- name: Create Github release | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{ steps.tagger.outputs.version }} | |
- name: Login to Github Container Registry | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
id: build-and-push | |
with: | |
context: . | |
platforms: linux/amd64 #,linux/arm64 | |
push: true | |
tags: | | |
ghcr.io/cloudit:${{ steps.tagger.outputs.version-without-v }} | |
- name: Sign image with a key | |
run: | | |
cosign sign --yes --key env://COSIGN_PRIVATE_KEY "ghcr.io/cloudit:${{ steps.tagger.outputs.version-without-v }}@${DIGEST}" | |
env: | |
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }} | |
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }} | |
DIGEST: ${{ steps.build-and-push.outputs.digest }} |