|
1 | 1 | name: Docker |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - branches: ["master"] |
6 | 4 | pull_request: |
7 | 5 | branches: ["master"] |
8 | 6 | release: |
|
13 | 11 | IMAGE_NAME: getstream/tikv-ui |
14 | 12 |
|
15 | 13 | 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' |
19 | 17 | runs-on: ubuntu-latest |
20 | 18 | permissions: |
21 | 19 | contents: read |
22 | | - packages: write |
23 | | - id-token: write |
24 | 20 |
|
25 | 21 | steps: |
26 | 22 | - name: Checkout repository |
27 | 23 | uses: actions/checkout@v4 |
28 | 24 |
|
29 | | - # Set up QEMU for multi-arch builds |
30 | | - - name: Set up QEMU |
31 | | - uses: docker/setup-qemu-action@v3 |
32 | | - |
33 | 25 | - name: Set up Docker Buildx |
34 | 26 | uses: docker/setup-buildx-action@v3 |
35 | 27 |
|
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) |
47 | 29 | uses: docker/build-push-action@v5 |
48 | 30 | with: |
49 | 31 | context: . |
50 | | - platforms: linux/amd64,linux/arm64 |
| 32 | + platforms: linux/amd64 |
51 | 33 | push: false |
52 | | - tags: ${{ steps.meta.outputs.tags }} |
53 | | - labels: ${{ steps.meta.outputs.labels }} |
54 | 34 | cache-from: type=gha |
55 | 35 | cache-to: type=gha,mode=max |
56 | 36 |
|
| 37 | + # Full multi-arch build, push, and sign for releases |
57 | 38 | release: |
58 | | - # Only run when a GitHub Release is published |
59 | 39 | if: github.event_name == 'release' |
60 | 40 | runs-on: ubuntu-latest |
61 | 41 | permissions: |
|
72 | 52 | with: |
73 | 53 | cosign-release: "v2.2.4" |
74 | 54 |
|
75 | | - # Set up QEMU for multi-arch builds |
76 | 55 | - name: Set up QEMU |
77 | 56 | uses: docker/setup-qemu-action@v3 |
78 | 57 |
|
|
86 | 65 | username: ${{ github.actor }} |
87 | 66 | password: ${{ secrets.GITHUB_TOKEN }} |
88 | 67 |
|
89 | | - - name: Extract Docker metadata (release) |
| 68 | + - name: Extract Docker metadata |
90 | 69 | id: meta |
91 | 70 | uses: docker/metadata-action@v5 |
92 | 71 | with: |
|
0 commit comments