-
Notifications
You must be signed in to change notification settings - Fork 23
39 lines (39 loc) · 1.26 KB
/
image-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# 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 release URL
id: fetch_release_url
run: |
echo "LATEST_RELEASE=$(curl -s "https://api.github.com/repos/stacklok/codegate-ui/releases/latest" | jq -r '.zipball_url')" >> $GITHUB_ENV
- name: Test build on x86
id: docker_build
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc # 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
build-args: |
LATEST_RELEASE=${{ env.LATEST_RELEASE }}