File tree 2 files changed +18
-9
lines changed
2 files changed +18
-9
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 @@ -24,20 +24,29 @@ COPY . /app
24
24
# Build the webapp
25
25
FROM node:23-slim AS webbuilder
26
26
27
+
28
+
27
29
# Install curl for downloading the webapp from GH and unzip to extract it
28
30
RUN apt-get update && apt-get install -y --no-install-recommends \
29
31
curl \
32
+ jq \
30
33
unzip\
31
34
ca-certificates
32
35
33
36
WORKDIR /usr/src/
34
37
35
- # To ensure we always download the latest release of the webapp, we use a build argument.
36
- # This prevents the curl command from being cached by Docker.
38
+ # Set build arg for latest release URL (optional)
39
+ ARG LATEST_RELEASE
37
40
38
- ARG LATEST_RELEASE=LATEST
39
- RUN echo "Latest FE release: $LATEST_RELEASE"
40
- RUN LATEST_RELEASE=${LATEST_RELEASE} curl -L -o main.zip ${LATEST_RELEASE}
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
41
50
42
51
# Extract the downloaded zip file
43
52
RUN unzip main.zip
@@ -111,4 +120,4 @@ USER codegate
111
120
112
121
# Set the container's default entrypoint
113
122
EXPOSE 8989
114
- ENTRYPOINT ["/app/scripts/entrypoint.sh" ]
123
+ ENTRYPOINT ["/app/scripts/entrypoint.sh" ]
You can’t perform that action at this time.
0 commit comments