Skip to content

Commit e8f88e4

Browse files
authored
Merge pull request #884 from onflow/peter/allow-specifying-build-tag
Allow specifying a tag when building images
2 parents 4481ad0 + d07277e commit e8f88e4

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
name: "Build & Push EVM Gateway Image to Public Repo"
22

33
on:
4-
push:
5-
tags:
6-
- '*'
74
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: 'Git tag to build. Also used as the docker image tag.'
8+
required: true
9+
type: string
810

911
env:
1012
DOCKER_IMAGE_URL: ${{ vars.REPO_DOCKER_IMAGE_URL }}
@@ -20,10 +22,7 @@ jobs:
2022
with:
2123
fetch-depth: 0
2224
fetch-tags: true
23-
24-
- name: Set Gateway Version
25-
id: set_version
26-
run: echo "GATEWAY_VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo 'unknown')" >> $GITHUB_OUTPUT
25+
ref: ${{ inputs.tag }}
2726

2827
- name: Google auth
2928
id: auth
@@ -41,5 +40,5 @@ jobs:
4140
- name: Docker Auth
4241
run: |-
4342
gcloud auth configure-docker ${{ vars.GAR_LOCATION }}-docker.pkg.dev
44-
docker build --build-arg VERSION="${{ steps.set_version.outputs.GATEWAY_VERSION }}" --build-arg ARCH=amd64 -t ${{ env.DOCKER_IMAGE_URL }}:${{ steps.set_version.outputs.GATEWAY_VERSION }} --file Dockerfile .
45-
docker push ${{ env.DOCKER_IMAGE_URL }}:${{ steps.set_version.outputs.GATEWAY_VERSION }}
43+
docker build --build-arg VERSION="${{ inputs.tag }}" --build-arg ARCH=amd64 -t ${{ env.DOCKER_IMAGE_URL }}:${{ inputs.tag }} --file Dockerfile .
44+
docker push ${{ env.DOCKER_IMAGE_URL }}:${{ inputs.tag }}

0 commit comments

Comments
 (0)