Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Commit 0791950

Browse files
Add build-arg in make image-build command
The build-arg prevents that the step for downloading the UI code is cached. This way we can ensure that we are always using the latest releasee from the UI when building the image locally. The build-arg is already present in the GH action to build and publish the image. Additionally, remove the `secret` provided to the GH action to build the image. It was used when the containers were not public
1 parent 7e2f1e8 commit 0791950

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

.github/workflows/image-build.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,5 @@ jobs:
3535
load: true
3636
cache-from: type=gha
3737
cache-to: type=gha,mode=max
38-
secrets: |
39-
gh_token=${{ secrets.GH_CI_TOKEN }}
4038
build-args: |
4139
LATEST_RELEASE=${{ env.LATEST_RELEASE }}

.github/workflows/image-publish.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ jobs:
8585
labels: ${{ steps.docker-metadata.outputs.labels }}
8686
cache-from: type=gha
8787
cache-to: type=gha,mode=max
88-
secrets: |
89-
gh_token=${{ secrets.GH_CI_TOKEN }}
9088
build-args: |
9189
LATEST_RELEASE=${{ env.LATEST_RELEASE }}
9290
- name: Capture Image Digest

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.PHONY: clean install format lint test security build all
22
CONTAINER_BUILD?=docker buildx build
3-
VER?=0.1.0
3+
VER?=0.1.7
44

55
clean:
66
rm -rf build/
@@ -30,6 +30,12 @@ build: clean test
3030
poetry build
3131

3232
image-build:
33-
DOCKER_BUILDKIT=1 $(CONTAINER_BUILD) -f Dockerfile --secret id=gh_token,env=GH_CI_TOKEN -t codegate . -t ghcr.io/stacklok/codegate:$(VER) --load
33+
DOCKER_BUILDKIT=1 $(CONTAINER_BUILD) \
34+
-f Dockerfile \
35+
--build-arg LATEST_RELEASE=$(curl -s "https://api.github.com/repos/stacklok/codegate-ui/releases/latest" | grep '"zipball_url":' | cut -d '"' -f 4) \
36+
-t codegate \
37+
. \
38+
-t ghcr.io/stacklok/codegate:$(VER) \
39+
--load
3440

3541
all: clean install format lint test security build

0 commit comments

Comments
 (0)