Skip to content

Commit

Permalink
ci: add build-arm64 and build-initializer option for dev-build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
zyy17 committed Nov 20, 2024
1 parent aec1fc8 commit 9962f38
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/dev-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ on:
commit: # Note: We only pull the source code and use the current workflow to build the artifacts.
description: The commit to build, default to the latest commit in the current branch.
required: false
build-arm64: # only build amd64 image by default, it will make the build faster.
type: boolean
description: Whether to build arm64 image
required: false
default: false
build-initializer:
type: boolean
description: Whether to build initializer image
required: false
default: false

env:
GO_VERSION: "1.23"
Expand Down Expand Up @@ -85,12 +95,21 @@ jobs:
VERSION="dev-$(date "+%Y%m%d-%s")-$(echo "${{ env.COMMIT }}" | cut -c1-8)"
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Determine the platforms to build
shell: bash
run: |
PLATFORMS="linux/amd64"
if ${{ inputs.build-arm64 }}; then
PLATFORMS="linux/amd64,linux/arm64"
fi
echo "PLATFORMS=${PLATFORMS}" >> $GITHUB_ENV
- name: Build and push operator
uses: docker/build-push-action@v5
with:
context: ${{ env.CHECKOUT_SOURCE_PATH }}
file: ./docker/operator/Dockerfile
platforms: linux/amd64,linux/arm64
platforms: ${{ env.PLATFORMS }}
push: true
tags: |
greptime/greptimedb-operator-dev:latest
Expand All @@ -101,11 +120,12 @@ jobs:
${{ vars.ECR_REGISTRY }}/greptime/greptimedb-operator-dev:${{ env.VERSION }}
- name: Build and push initializer
if: ${{ inputs.build-initializer }}
uses: docker/build-push-action@v5
with:
context: ${{ env.CHECKOUT_SOURCE_PATH }}
file: ./docker/initializer/Dockerfile
platforms: linux/amd64,linux/arm64
platforms: ${{ env.PLATFORMS }}
push: true
tags: |
greptime/greptimedb-initializer-dev:latest
Expand Down

0 comments on commit 9962f38

Please sign in to comment.