push-ubi #7
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: push-ubi | |
on: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
env: | |
CONTROLLER: ${{ github.event.repository.name }} | |
jobs: | |
flux-push: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write # for creating OIDC tokens for signing. | |
packages: write # for pushing and signing container images. | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Prepare | |
id: prep | |
run: | | |
RELEASE=$(gh release view --json tagName -q '.tagName') | |
echo "VERSION=${RELEASE}" >> $GITHUB_OUTPUT | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a # v3.3.0 | |
- name: Setup Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Generate images meta | |
id: meta | |
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1 | |
with: | |
images: | | |
ghcr.io/controlplaneio-fluxcd/${{ env.CONTROLLER }} | |
tags: | | |
type=raw,value=${{ steps.prep.outputs.VERSION }}-ubi | |
- name: Publish images | |
id: build-push | |
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc # v6.11.0 | |
with: | |
sbom: true | |
provenance: true | |
push: true | |
builder: ${{ steps.buildx.outputs.name }} | |
context: . | |
file: ./config/olm/build/Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
build-args: "VERSION=${{ steps.prep.outputs.VERSION }}" | |
- uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0 | |
- name: Sign images | |
env: | |
COSIGN_EXPERIMENTAL: 1 | |
run: | | |
cosign sign --yes ghcr.io/controlplaneio-fluxcd/${{ env.CONTROLLER }}@${{ steps.build-push.outputs.digest }} |