Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Fetch latest FE commit SHA
id: fetch_commit_fe_sha
run: |
echo "LATEST_COMMIT_SHA=$(curl -LSsk 'https://api.github.com/repos/stacklok/codegate-ui/commits?per_page=1' -H 'Authorization: Bearer ${{ secrets.GH_CI_TOKEN }}' | jq -r '.[0].sha')" >> $GITHUB_ENV
echo "LATEST_RELEASE=$(curl -s "https://api.github.com/repos/stacklok/codegate-ui/releases/latest" -H "Authorization: Bearer ${{ secrets.GH_CI_TOKEN }}" | grep '"zipball_url":' | cut -d '"' -f 4)" >> $GITHUB_ENV
- name: Test build on x86
id: docker_build
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v5
Expand All @@ -38,4 +38,4 @@ jobs:
secrets: |
gh_token=${{ secrets.GH_CI_TOKEN }}
build-args: |
LATEST_COMMIT_SHA=${{ env.LATEST_COMMIT_SHA }}
LATEST_RELEASE=${{ env.LATEST_RELEASE }}
5 changes: 2 additions & 3 deletions .github/workflows/image-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ jobs:
- name: Fetch latest FE commit SHA
id: fetch_commit_fe_sha
run: |
echo "LATEST_COMMIT_SHA=$(curl -LSsk 'https://api.github.com/repos/stacklok/codegate-ui/commits?per_page=1' -H 'Authorization: Bearer ${{ secrets.GH_CI_TOKEN }}' | jq -r '.[0].sha')" >> $GITHUB_ENV
echo "Fetched LATEST_COMMIT_SHA: $LATEST_COMMIT_SHA"
echo "LATEST_RELEASE=$(curl -s "https://api.github.com/repos/stacklok/codegate-ui/releases/latest" -H "Authorization: Bearer ${{ secrets.GH_CI_TOKEN }}" | grep '"zipball_url":' | cut -d '"' -f 4)" >> $GITHUB_ENV
- name: Rename to accommodate to image
run: mv ./backup_weaviate ./weaviate_backup
- name: Download git lfs dependencies
Expand All @@ -88,7 +87,7 @@ jobs:
secrets: |
gh_token=${{ secrets.GH_CI_TOKEN }}
build-args: |
LATEST_COMMIT_SHA=${{ env.LATEST_COMMIT_SHA }}
LATEST_RELEASE=${{ env.LATEST_RELEASE }}
- name: Capture Image Digest
id: image-digest
run: |
Expand Down
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \

WORKDIR /usr/src/

# To ensure we always download the latest release of the webapp, we use a build argument.
# This prevents the curl command from being cached by Docker.
ARG LATEST_RELEASE=LATEST
RUN echo "Latest FE release: $LATEST_RELEASE"
RUN --mount=type=secret,id=gh_token \
curl -s -H "Authorization: Bearer $(cat /run/secrets/gh_token)" https://api.github.com/repos/stacklok/codegate-ui/releases/latest \
| grep '"zipball_url":' \
| cut -d '"' -f 4 \
| xargs -n 1 -I {} curl -L -H "Authorization: Bearer $(cat /run/secrets/gh_token)" -o main.zip {}
LATEST_RELEASE=${LATEST_RELEASE} \
curl -L -H "Authorization: Bearer $(cat /run/secrets/gh_token)" -o main.zip ${LATEST_RELEASE}

# Extract the downloaded zip file
RUN unzip main.zip
Expand Down
Loading