Build and push trustee-attester container image #90
This file contains hidden or 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: "Build and push trustee-attester container image" | |
| env: | |
| NAME: "trustee-attester" | |
| REGISTRY: "quay.io/trusted-execution-clusters" | |
| COMMIT: "v0.17.0" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'containerfiles/trustee-attester.container' | |
| - '.github/workflows/build-trustee-attester-image.yml' | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - 'containerfiles/trustee-attester.container' | |
| - '.github/workflows/build-trustee-attester-image.yml' | |
| schedule: | |
| - cron: '0 0 * * MON' | |
| workflow_dispatch: | |
| permissions: read-all | |
| # Prevent multiple workflow runs from racing to ensure that pushes are made | |
| # sequentially for the main branch. Also cancel in progress workflow runs for | |
| # pull requests only. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| build-trustee-attester-image: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - tag: fedora | |
| base: fedora:rawhide | |
| variant: standard | |
| attesters: snp-attester,tdx-attester,az-snp-vtpm-attester,az-tdx-vtpm-attester,tpm-attester | |
| - tag: fedora | |
| base: fedora:rawhide | |
| variant: without-tpm | |
| attesters: snp-attester,tdx-attester,az-snp-vtpm-attester,az-tdx-vtpm-attester | |
| - tag: centos-stream | |
| base: quay.io/centos/centos:stream9 | |
| variant: standard | |
| attesters: snp-attester,tdx-attester,az-snp-vtpm-attester,az-tdx-vtpm-attester,tpm-attester | |
| - tag: centos-stream | |
| base: quay.io/centos/centos:stream9 | |
| variant: without-tpm | |
| attesters: snp-attester,tdx-attester,az-snp-vtpm-attester,az-tdx-vtpm-attester | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Generate image tag | |
| id: generate-tag | |
| run: | | |
| TAG="${{ matrix.tag }}-${{ matrix.variant }}-${{ env.COMMIT }}" | |
| echo "tag=${TAG}" >> $GITHUB_OUTPUT | |
| - name: Build trustee-attester image (${{ matrix.tag }}-${{ matrix.variant }}) | |
| id: build-image | |
| uses: redhat-actions/buildah-build@v2 | |
| with: | |
| image: ${{ env.NAME }} | |
| tags: ${{ steps.generate-tag.outputs.tag }} | |
| containerfiles: | | |
| containerfiles/trustee-attester.container | |
| context: containerfiles | |
| oci: true | |
| build-args: | | |
| BASE=${{ matrix.base }} | |
| COMMIT=${{ env.COMMIT }} | |
| ATTESTERS=${{ matrix.attesters }} | |
| - name: Push trustee-attester image (${{ matrix.tag }}-${{ matrix.variant }}) to registry | |
| uses: redhat-actions/push-to-registry@v2 | |
| if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule') && github.ref == 'refs/heads/main' && github.repository_owner == 'trusted-execution-clusters' | |
| with: | |
| image: ${{ steps.build-image.outputs.image }} | |
| tags: ${{ steps.generate-tag.outputs.tag }} | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ secrets.REGISTRY_USERNAME }} | |
| password: ${{ secrets.REGISTRY_PASSWORD }} |