Skip to content

Update main.yml

Update main.yml #29

Workflow file for this run

name: Publish Docker images
on:
push:
branches:
- 'main'
jobs:
push_to_registry:
name: Build and push docker ${{ matrix.ubuntu }} ${{ matrix.commit }} ${{ matrix.build }} ${{ matrix.projects }} ${{ matrix.targets }} ${{ matrix.url }}
runs-on: large22
strategy:
fail-fast: false
matrix:
ubuntu: [22.04]
url: ["https://github.com/llvm/llvm-project"]
commit: ["llvmorg-11.1.0", "llvmorg-12.0.1", "llvmorg-13.0.1", "llvmorg-14.0.6", "llvmorg-15.0.7", "llvmorg-16.0.6", "llvmorg-17.0.5"]
build: ["Debug", "Release"]
projects: ["clang;lld"]
targets: ["X86"]
include:
- projects: "clang;lld;mlir"
commit: "llvmorg-16.0.6"
- projects: "clang;lld;mlir"
commit: "b7a249d26fe61432050df470d23bdea417fda574"
permissions:
packages: write
contents: read
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}/ubuntu-${{ matrix.ubuntu }}-${{ matrix.llvm }}-${{ matrix.build }}-projects-${{ join(matrix.project, '-') }}-${{ join(matrix.targets, '-') }}
steps:
- uses: AutoModality/action-clean@v1
- name: Check out the repo
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: linux/amd64
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Log in to GitHub Docker Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image (amd64 & arm64)
uses: docker/build-push-action@v5
with:
context: .
builder: ${{ steps.buildx.outputs.name }}
platforms: linux/amd64
build-args: |
UBUNTU_VERSION=${{ matrix.ubuntu }}
LLVM_URL=${{ matrix.url }}
LLVM_COMMIT=${{ matrix.commit }}
BUILD_TYPE=${{ matrix.build }}
PROJECTS=${{ matrix.projects }}
TARGETS=${{ matrix.targets }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=min