Build RBE Image #2
This file contains hidden or 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
| 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 }} |