chore(deps): update all non-major dependencies in .github/workflows/t… #16
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: | |
- '*' | |
# Declare default permissions as read only. | |
permissions: read-all | |
env: | |
REPO: ghcr.io/coreruleset/albedo | |
jobs: | |
goreleaser: | |
runs-on: ubuntu-latest | |
permissions: | |
# https://goreleaser.com/ci/actions/#token-permissions | |
contents: write | |
packages: write | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
fetch-depth: 0 | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@5927c834f5b4fdf503fca6f4c7eccda82949e1ee # v3.1.0 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@4fd812986e6c8c2a69e18311145f9371337f27d4 # v3.4.0 | |
- | |
name: Set up Go | |
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 | |
with: | |
go-version: ^1.22 | |
cache: true | |
- | |
name: Login to GitHub Container Registry | |
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- | |
name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
version: latest | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
publish-images: | |
name: Build images | |
runs-on: ubuntu-latest | |
needs: | |
- goreleaser | |
permissions: | |
contents: read | |
packages: write | |
id-token: write # needed for signing the images with GitHub OIDC Token | |
steps: | |
- name: Checkout | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
with: | |
fetch-depth: 1 | |
- name: Install Cosign | |
uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 # v3.5.0 | |
# https://github.com/docker/setup-qemu-action | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@5927c834f5b4fdf503fca6f4c7eccda82949e1ee # v3 | |
# https://github.com/docker/setup-buildx-action | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@4fd812986e6c8c2a69e18311145f9371337f27d4 # v3.4.0 | |
with: | |
driver-opts: image=moby/buildkit:master | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build images | |
id: build-and-push | |
env: | |
GIT_TAG: ${{ github.ref_name }} | |
uses: docker/bake-action@dbdf67d511c64f5af9363b359bf1c3c94a92fcfd # v5.3.0 | |
with: | |
files: | | |
./docker-bake.hcl | |
targets: default | |
push: true | |
provenance: true | |
sbom: true | |
- name: Sign the images with GitHub OIDC Token | |
env: | |
METADATA: ${{ steps.build-and-push.outputs.metadata }} | |
run: | | |
DIGEST=$(echo ${METADATA} | jq -r '.[] | ."containerimage.digest"') | |
TAGS=$(echo ${METADATA} | jq -r '.[] | ."image.name" | tostring' | tr ',' '\n') | |
images="" | |
for tag in ${TAGS}; do | |
images+="${tag}@${DIGEST} " | |
done | |
cosign sign --yes ${images} | |
verify-images: | |
name: Verify images | |
runs-on: ubuntu-latest | |
needs: | |
- publish-images | |
steps: | |
- name: Run container | |
run: | | |
tag="$(sed 's/^v//' <<<"${{ github.ref_name }}")" | |
image_ref="${REPO}:${tag}" | |
echo "Pulling ${image_ref} ..." | |
docker pull "${image_ref}" | |
echo "Starting container ${image_ref} ..." | |
docker run --pull "never" -d --name albedo-test "${image_ref}" | |
docker logs albedo-test | |
- name: Verify container | |
run: | | |
[ $(docker inspect albedo-test --format='{{.State.Running}}') = 'true' ] |