File tree 2 files changed +15
-5
lines changed
2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -20,10 +20,10 @@ jobs:
20
20
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
21
21
- name : Set up Docker Buildx
22
22
uses : docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3
23
- - name : Fetch latest FE commit SHA
24
- id : fetch_commit_fe_sha
23
+ - name : Fetch latest release URL
24
+ id : fetch_release_url
25
25
run : |
26
- echo "LATEST_RELEASE=$(curl -s "https://api.github.com/repos/stacklok/codegate-ui/releases/latest" | grep '"zipball_url":' | cut -d '"' -f 4 )" >> $GITHUB_ENV
26
+ echo "LATEST_RELEASE=$(curl -s "https://api.github.com/repos/stacklok/codegate-ui/releases/latest" | jq -r '.zipball_url' )" >> $GITHUB_ENV
27
27
- name : Test build on x86
28
28
id : docker_build
29
29
uses : docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v5
Original file line number Diff line number Diff line change @@ -35,8 +35,18 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
35
35
36
36
WORKDIR /usr/src/
37
37
38
- # Set the release URL (this should be static and not change often) and download latest
39
- RUN curl -s https://api.github.com/repos/stacklok/codegate-ui/releases/latest | jq -r '.zipball_url' | xargs curl -L -o main.zip
38
+ # Set build arg for latest release URL (optional)
39
+ ARG LATEST_RELEASE
40
+
41
+ # Download the latest release - if LATEST_RELEASE is provided use it, otherwise fetch from API
42
+ RUN if [ -n "$LATEST_RELEASE" ]; then \
43
+ echo "Using provided release URL" && \
44
+ curl -L -o main.zip "${LATEST_RELEASE}" ; \
45
+ else \
46
+ echo "Fetching latest release URL" && \
47
+ curl -s https://api.github.com/repos/stacklok/codegate-ui/releases/latest | \
48
+ jq -r '.zipball_url' | xargs curl -L -o main.zip; \
49
+ fi
40
50
41
51
# Extract the downloaded zip file
42
52
RUN unzip main.zip
You can’t perform that action at this time.
0 commit comments