Skip to content

ci: move to github registry instead of dockerhub #329

ci: move to github registry instead of dockerhub

ci: move to github registry instead of dockerhub #329

name: Build and release
on:
pull_request:
branches:
- main
push:
branches:
- main
env:
REGISTRY: ghcr.io
IMAGE_NAME: matter-labs/llvm_runner
jobs:
handle_image:
runs-on: matterlabs-default-infra-runners
permissions:
contents: read
packages: write
attestations: write
id-token: write
strategy:
matrix:
# image_version: [ "ubuntu20-llvm17", "ubuntu22-llvm15", "ubuntu22-llvm17"]
image_version: [ "ubuntu22-llvm17" ]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: images/llvm_runner/${{ matrix.image_version }}.Dockerfile
ignore: DL4006
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: 'linux/amd64,linux/arm64'
- 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 }}/${{ env.IMAGE_NAME }}/${{ matrix.image_version }}
flavor: latest=true
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v5
with:
# push: ${{ github.event_name == 'push' }}
push: true
file: images/llvm_runner/${{ matrix.image_version }}.Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: 'linux/amd64,linux/arm64,linux/arm64/v8'
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/${{ matrix.image_version }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true