Skip to content

Build RBE Image

Build RBE Image #2

name: Build RBE Image
permissions:
packages: write
on:
workflow_dispatch:
inputs:
release_version:
description: "Release version"
release:
types: [published]
jobs:
build:
runs-on:
- ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Get release tag
id: releaseTag
run: |
if [[ "${{ github.event_name }}" == "release" ]]; then
echo "tag=${{ github.event.release.tagName }}" >> $GITHUB_OUTPUT
else
echo "tag=${{ inputs.release_version }}" >> $GITHUB_OUTPUT
fi
- name: Prepare build args
id: buildEnv
run: |
echo "llvm_version=$(echo "${{ steps.releaseTag.outputs.tag }}" | cut -d '-' -f 1 | tr -d '\n')" >> $GITHUB_OUTPUT
echo "release_revision=$(echo "${{ steps.releaseTag.outputs.tag }}" | cut -d '-' -f 2 | tr -d '\n')" >> $GITHUB_OUTPUT
- name: Login to GHCR
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Build and push
uses: docker/build-push-action@v7
with:
context: .
push: true
tags: "ghcr.io/${{ github.repository_owner }}/envoy-build:${{ steps.releaseTag.outputs.tag }}"
file: envoy-build.dockerfile
platforms: linux/amd64
build-args: |
LLVM_VERSION=${{ steps.buildEnv.outputs.llvm_version }}
RELEASE_REVISION=${{ steps.buildEnv.outputs.release_revision }}
REPOSITORY=${{ github.repository }}
labels: |
org.opencontainers.image.source=https://github.com/${{ github.repository }}