|
| 1 | +name: push-ubi |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | + |
| 5 | +permissions: |
| 6 | + contents: read |
| 7 | + |
| 8 | +env: |
| 9 | + CONTROLLER: ${{ github.event.repository.name }} |
| 10 | + |
| 11 | +jobs: |
| 12 | + flux-push: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + permissions: |
| 15 | + id-token: write # for creating OIDC tokens for signing. |
| 16 | + packages: write # for pushing and signing container images. |
| 17 | + steps: |
| 18 | + - name: Checkout |
| 19 | + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 |
| 20 | + - name: Prepare |
| 21 | + id: prep |
| 22 | + run: | |
| 23 | + RELEASE=$(gh release view --json tagName -q '.tagName') |
| 24 | + echo "VERSION=${RELEASE}" >> $GITHUB_OUTPUT |
| 25 | + env: |
| 26 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 27 | + - name: Setup QEMU |
| 28 | + uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0 |
| 29 | + - name: Setup Docker Buildx |
| 30 | + id: buildx |
| 31 | + uses: docker/setup-buildx-action@aa33708b10e362ff993539393ff100fa93ed6a27 # v3.5.0 |
| 32 | + - name: Login to GitHub Container Registry |
| 33 | + uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 |
| 34 | + with: |
| 35 | + registry: ghcr.io |
| 36 | + username: ${{ github.actor }} |
| 37 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 38 | + - name: Generate images meta |
| 39 | + id: meta |
| 40 | + uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 |
| 41 | + with: |
| 42 | + images: | |
| 43 | + ghcr.io/controlplaneio-fluxcd/${{ env.CONTROLLER }} |
| 44 | + tags: | |
| 45 | + type=raw,value=${{ steps.prep.outputs.VERSION }}-ubi |
| 46 | + - name: Publish images |
| 47 | + id: build-push |
| 48 | + uses: docker/build-push-action@5176d81f87c23d6fc96624dfdbcd9f3830bbe445 # v6.5.0 |
| 49 | + with: |
| 50 | + sbom: true |
| 51 | + provenance: true |
| 52 | + push: true |
| 53 | + builder: ${{ steps.buildx.outputs.name }} |
| 54 | + context: . |
| 55 | + file: ./config/olm/build/Dockerfile |
| 56 | + platforms: linux/amd64,linux/arm64 |
| 57 | + tags: ${{ steps.meta.outputs.tags }} |
| 58 | + labels: ${{ steps.meta.outputs.labels }} |
| 59 | + build-args: "VERSION=${{ steps.prep.outputs.VERSION }}" |
| 60 | + - uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 # v3.5.0 |
| 61 | + - name: Sign images |
| 62 | + env: |
| 63 | + COSIGN_EXPERIMENTAL: 1 |
| 64 | + run: | |
| 65 | + cosign sign --yes ghcr.io/controlplaneio-fluxcd/${{ env.CONTROLLER }}@${{ steps.build-push.outputs.digest }} |
0 commit comments