Skip to content

ci: Add reusable build workflow #224

ci: Add reusable build workflow

ci: Add reusable build workflow #224

Workflow file for this run

name: Envoy/build-tools
permissions:
contents: read
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.event.inputs.head_ref || github.run_id }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
build_image:
if: >-
${{
github.repository == 'envoyproxy/envoy-build-tools'
|| vars.ENVOY_CI_RUN == 'true'
}}
strategy:
fail-fast: false
matrix:
include:
- target: ubuntu
name: Linux Ubuntu
gcr_push: true
- target: centos
name: Linux Centos
gcr_push: false
- target: windows2019
name: Windows 2019
gcr_push: true
gcr_name: envoy-build-windows
host_platform: windows-2019
os_family: windows
name: Build (${{ matrix.name || matrix.target }})
uses: ./.github/workflows/_build_image.yml
with:
distro: ${{ matrix.target }}
gcr_push: ${{ matrix.gcr_push }}
gcr_name: ${{ matrix.gcr_name != '' && matrix.gcr_name || 'envoy-build' }}
os_family: ${{ matrix.os_family != '' && matrix.os_family || 'linux' }}
host_platform: ${{ matrix.host_platform != '' && matrix.host_platform || 'ubuntu-22.04' }}
test_toolchain: ${{ matrix.target != 'centos' }}
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
gcp_key: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
regenerate_linux:
runs-on: ubuntu-20.04
if: ${{ github.event_name != 'pull_request' }}
permissions:
contents: write
name: Regenerate toolchains (Linux)
needs:
- build_image
steps:
- id: appauth
uses: envoyproxy/toolshed/gh-actions/[email protected]
with:
key: ${{ secrets.ENVOY_CI_UPDATE_BOT_KEY }}
app_id: ${{ secrets.ENVOY_CI_UPDATE_APP_ID }}
- name: 'Checkout Repository'
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ steps.appauth.outputs.token }}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.16'
- run: |
toolchains/regenerate.sh
env:
COMMIT_TOOLCHAINS: true
GCR_IMAGE_NAME: envoy-build
OS_FAMILY: linux
SOURCE_BRANCH: ${{ github.ref }}
regenerate_windows:
runs-on: windows-2019
if: ${{ github.event_name != 'pull_request' }}
permissions:
contents: write
name: Regenerate toolchains (Windows)
needs:
- regenerate_linux
steps:
- id: appauth
uses: envoyproxy/toolshed/gh-actions/[email protected]
with:
key: ${{ secrets.ENVOY_CI_UPDATE_BOT_KEY }}
app_id: ${{ secrets.ENVOY_CI_UPDATE_APP_ID }}
- name: 'Checkout Repository'
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ steps.appauth.outputs.token }}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.16'
- run: |
toolchains/regenerate.sh
shell: bash
env:
COMMIT_TOOLCHAINS: true
GCR_IMAGE_NAME: envoy-build-windows
OS_FAMILY: windows
SOURCE_BRANCH: ${{ github.ref }}