Skip to content

Commit

Permalink
Merge pull request #496 from stacklok/fix-ci
Browse files Browse the repository at this point in the history
Fix CI by removing the need for a secret
  • Loading branch information
yrobla authored Jan 7, 2025
2 parents acbf2c9 + ab5a7ce commit 4d8dd3c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .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_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
echo "LATEST_RELEASE=$(curl -s "https://api.github.com/repos/stacklok/codegate-ui/releases/latest" | 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 Down
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,10 @@ 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 \
LATEST_RELEASE=${LATEST_RELEASE} \
curl -L -H "Authorization: Bearer $(cat /run/secrets/gh_token)" -o main.zip ${LATEST_RELEASE}
RUN LATEST_RELEASE=${LATEST_RELEASE} curl -L -o main.zip ${LATEST_RELEASE}

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

0 comments on commit 4d8dd3c

Please sign in to comment.