Skip to content

docker image

docker image #16

Workflow file for this run

name: docker image
on:
workflow_dispatch:
inputs:
UBUNTU_VERSION:
description: "base ubuntu version"
required: true
default: "lunar-20230731"
type: string
CLANG_VERSION:
description: "clang apt package version"
required: true
default: "16"
type: string
jobs:
release:
runs-on: ${{ matrix.builder }}
strategy:
matrix:
include:
- builder: ubuntu-latest
platform: amd64
- builder: ubuntu-latest # buildjet-2vcpu-ubuntu-2204-arm
platform: arm64
steps:
- name: Checkout Code
uses: actions/checkout@v1
# not necessary as build is native on ARM
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v2
with:
file: Dockerfile
push: true
provenance: false # https://github.com/docker/buildx/issues/1608
platforms: linux/${{ matrix.platform }}
build-args: |
UBUNTU_VERSION=${{ inputs.UBUNTU_VERSION }}
CLANG_VERSION=${{ inputs.CLANG_VERSION }}
tags: |
ghcr.io/${{ github.repository_owner }}/clang-tools:latest-${{ matrix.platform }}
ghcr.io/${{ github.repository_owner }}/clang-tools:${{ inputs.CLANG_VERSION }}-${{ matrix.platform }}
manifest:
runs-on: ubuntu-latest
needs: release
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- name: Create and push manifest images for latest
uses: Noelware/docker-manifest-action@master
with:
base-image: ghcr.io/${{ github.repository_owner }}/clang-tools:latest
extra-images: ghcr.io/${{ github.repository_owner }}/clang-tools:latest-amd64,ghcr.io/${{ github.repository_owner }}/clang-tools:latest-arm64
push: true
- name: Create and push manifest images for specific version
uses: Noelware/docker-manifest-action@0.3.1
with:
base-image: ghcr.io/${{ github.repository_owner }}/clang-tools:${{ inputs.CLANG_VERSION }}
extra-images: ghcr.io/${{ github.repository_owner }}/clang-tools:${{ inputs.CLANG_VERSION }}-amd64,ghcr.io/${{ github.repository_owner }}/clang-tools:${{ inputs.CLANG_VERSION }}-arm64
push: true