Skip to content

Commit

Permalink
Merge pull request #13 from GreptimeTeam/chore/add_sha_to_build
Browse files Browse the repository at this point in the history
chore: add commit sha input to manually build action
  • Loading branch information
shuiyisong authored Dec 27, 2023
2 parents 303cdef + 3776f92 commit a6a4c88
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,22 @@ name: Build tsbs docker image manually

on:
workflow_dispatch:
inputs:
commitsha:
description: 'Commit sha to build image'
required: true
type: string

jobs:
docker:
name: Build and push image
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.commitsha }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

Expand All @@ -27,14 +37,15 @@ jobs:
- name: Configure build image tag
shell: bash
run: |
commitShortSHA=`echo ${GITHUB_SHA} | cut -c1-8`
commitShortSHA=`echo ${{ inputs.commitsha }} | cut -c1-8`
buildTime=`date +%Y%m%d%H%M%S`
IMAGE_TAG="$commitShortSHA-$buildTime"
echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV
- name: Build and push image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
Expand Down

0 comments on commit a6a4c88

Please sign in to comment.