Skip to content

Commit c4a1a0a

Browse files
improved gh workflow
1 parent a2d2296 commit c4a1a0a

File tree

1 file changed

+7
-28
lines changed

1 file changed

+7
-28
lines changed

.github/workflows/docker-publish.yml

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: Docker
22

33
on:
4-
push:
5-
branches: ["master"]
64
pull_request:
75
branches: ["master"]
86
release:
@@ -13,49 +11,31 @@ env:
1311
IMAGE_NAME: getstream/tikv-ui
1412

1513
jobs:
16-
build:
17-
# Build only for pushes/PRs, never for release
18-
if: github.event_name != 'release'
14+
# Fast validation build for PRs (single platform, no push)
15+
validate:
16+
if: github.event_name == 'pull_request'
1917
runs-on: ubuntu-latest
2018
permissions:
2119
contents: read
22-
packages: write
23-
id-token: write
2420

2521
steps:
2622
- name: Checkout repository
2723
uses: actions/checkout@v4
2824

29-
# Set up QEMU for multi-arch builds
30-
- name: Set up QEMU
31-
uses: docker/setup-qemu-action@v3
32-
3325
- name: Set up Docker Buildx
3426
uses: docker/setup-buildx-action@v3
3527

36-
- name: Extract Docker metadata (non-release)
37-
id: meta
38-
uses: docker/metadata-action@v5
39-
with:
40-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
41-
tags: |
42-
type=ref,event=branch
43-
type=ref,event=pr
44-
45-
- name: Build Docker image (no push)
46-
id: build
28+
- name: Build Docker image (validation only)
4729
uses: docker/build-push-action@v5
4830
with:
4931
context: .
50-
platforms: linux/amd64,linux/arm64
32+
platforms: linux/amd64
5133
push: false
52-
tags: ${{ steps.meta.outputs.tags }}
53-
labels: ${{ steps.meta.outputs.labels }}
5434
cache-from: type=gha
5535
cache-to: type=gha,mode=max
5636

37+
# Full multi-arch build, push, and sign for releases
5738
release:
58-
# Only run when a GitHub Release is published
5939
if: github.event_name == 'release'
6040
runs-on: ubuntu-latest
6141
permissions:
@@ -72,7 +52,6 @@ jobs:
7252
with:
7353
cosign-release: "v2.2.4"
7454

75-
# Set up QEMU for multi-arch builds
7655
- name: Set up QEMU
7756
uses: docker/setup-qemu-action@v3
7857

@@ -86,7 +65,7 @@ jobs:
8665
username: ${{ github.actor }}
8766
password: ${{ secrets.GITHUB_TOKEN }}
8867

89-
- name: Extract Docker metadata (release)
68+
- name: Extract Docker metadata
9069
id: meta
9170
uses: docker/metadata-action@v5
9271
with:

0 commit comments

Comments
 (0)