Publish #2
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
--- | |
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | |
name: Publish | |
on: | |
workflow_dispatch: {} | |
push: | |
branches: | |
- "coreweave" | |
jobs: | |
publish-images: | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: read | |
strategy: | |
fail-fast: true | |
matrix: | |
image: [speaker, controller, configmaptocrs] | |
steps: | |
- name: Set up QEMU | |
uses: docker/[email protected] | |
- name: Code checkout | |
uses: actions/checkout@v4 | |
- name: Setup docker buildx | |
uses: docker/[email protected] | |
- name: Log into registry ghcr.io | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set image tag | |
run: | | |
git remote add upstream https://github.com/metallb/metallb.git | |
git fetch --tags upstream | |
echo "VERSION=$(git describe --tags --exclude '*-' --abbrev=0)" >> $GITHUB_ENV | |
- name: Docker meta ${{ matrix.image }} | |
id: meta | |
uses: docker/[email protected] | |
with: | |
images: | | |
ghcr.io/${{ github.repository }}/${{ matrix.image }} | |
tags: | | |
type=sha,enable=true,prefix=${{ env.VERSION }}-,format=short | |
labels: | | |
org.opencontainers.image.title=${{ matrix.image }} | |
org.opencontainers.image.description=${{ matrix.image }} for metallb, a network load-balancer implementation for Kubernetes using standard routing protocols | |
- name: Build and push ${{ matrix.image }} | |
uses: docker/[email protected] | |
id: build-and-push | |
with: | |
context: . | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
file: ${{matrix.image}}/Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
push: true | |
build-args: | | |
GIT_BRANCH: ${{ github.ref_name }} | |
GIT_COMMIT: ${{ github.sha }} |