Revert "Remove the need for secrets at Docker build" #306
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Attempt to build (but not push) the Docker image on Pull Requests | |
name: Image build | |
on: | |
pull_request: | |
branches: | |
- main | |
paths-ignore: | |
- "**.md" | |
- "docs/**" | |
- "static/**" | |
- "LICENSE" | |
permissions: | |
contents: read | |
jobs: | |
docker-image: | |
name: Check docker image build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3 | |
- 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 | |
- name: Test build on x86 | |
id: docker_build | |
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v5 | |
with: | |
context: . | |
file: ./Dockerfile | |
platforms: linux/amd64 | |
push: false # Only attempt to build, to verify the Dockerfile is working | |
load: true | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
secrets: | | |
gh_token=${{ secrets.GH_CI_TOKEN }} | |
build-args: | | |
LATEST_RELEASE=${{ env.LATEST_RELEASE }} |