Initial base image pipeline for GHCR, just virtual for now #1
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: "Build and Publish CI Containers to GHCR" | |
on: | |
push: | |
tags: | |
- "ccf_test_ci_image/*" | |
env: | |
REGISTRY: ghcr.io | |
jobs: | |
build: | |
name: "Build and Publish CI Containers" | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
attestations: write | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Truncate ref | |
run: echo "tag=${GITHUB_REF#refs/tags/ccf_ci_image/}" >> $GITHUB_OUTPUT | |
id: tref | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/ccf/ci | |
- name: Build and push Virtual container | |
id: push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./docker/ccf_ci | |
build-args: | | |
platform=virtual | |
clang_version=15 | |
push: true | |
tags: ${{steps.tref.outputs.tag}}-virtual-clang15 | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Generate artifact attestation | |
uses: actions/attest-build-provenance@v1 | |
with: | |
subject-name: ${{ env.REGISTRY }}/ccf/ci | |
subject-digest: ${{ steps.push.outputs.digest }} | |
push-to-registry: true |