Skip to content

Commit ac90776

Browse files
committed
feat: add workflow to compare builders
1 parent e8ee878 commit ac90776

File tree

2 files changed

+32
-4
lines changed

2 files changed

+32
-4
lines changed

.github/workflows/ci.yaml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
name: Build and Push
22

33
on:
4+
workflow_call:
5+
inputs:
6+
builder_type:
7+
required: true
8+
type: string
9+
platforms:
10+
required: true
11+
type: string
412
workflow_dispatch:
513
inputs:
614
builder_type:
@@ -28,14 +36,15 @@ on:
2836
jobs:
2937
build:
3038
runs-on: ubuntu-latest
39+
environment: ${{ inputs.builder_type }}
3140
steps:
3241
- name: Checkout
3342
uses: actions/checkout@v4
3443

3544
- name: Determine platforms to build
3645
id: determine_platforms
3746
run: |
38-
case "${{ github.event.inputs.platforms }}" in
47+
case "${{ inputs.platforms }}" in
3948
amd64)
4049
echo "Building for amd64"
4150
PLATFORMS="linux/amd64"
@@ -62,15 +71,15 @@ jobs:
6271
password: ${{ secrets.DOCKER_PASSWORD }}
6372

6473
- name: Set up QEMU
65-
if: ${{ github.event.inputs.builder_type == 'local' }}
74+
if: ${{ inputs.builder_type == 'local' }}
6675
uses: docker/setup-qemu-action@v3
6776

6877
- name: Set up Docker Buildx (local)
69-
if: ${{ github.event.inputs.builder_type == 'local' }}
78+
if: ${{ inputs.builder_type == 'local' }}
7079
uses: docker/setup-buildx-action@v3
7180

7281
- name: Set up Docker Buildx (cloud)
73-
if: ${{ github.event.inputs.builder_type != 'local' }}
82+
if: ${{ inputs.builder_type != 'local' }}
7483
uses: docker/setup-buildx-action@v3
7584
with:
7685
version: lab:latest

.github/workflows/compare.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Compare Builders
2+
on:
3+
workflow_dispatch:
4+
5+
jobs:
6+
build_local:
7+
uses: ./.github/workflows/ci.yaml
8+
secrets: inherit
9+
with:
10+
builder_type: local
11+
platforms: multiplatform
12+
13+
build_cloud:
14+
uses: ./.github/workflows/ci.yaml
15+
secrets: inherit
16+
with:
17+
builder_type: cloud
18+
platforms: multiplatform
19+

0 commit comments

Comments
 (0)