Skip to content

Commit 19294f3

Browse files
authored
Merge pull request #2 from CentML/gflarity/only_push_for_release
only push images for a release, update actions improve build time for non releases
2 parents aa79e77 + 1c50d3a commit 19294f3

3 files changed

Lines changed: 34 additions & 163 deletions

File tree

.github/workflows/release.yml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ on:
44
push:
55
branches:
66
- "forked-main"
7-
tags:
8-
- "v*-centml"
97
pull_request:
108
branches:
119
- "forked-main"
1210
workflow_dispatch:
11+
release:
12+
types: [published]
1313

1414
jobs:
1515
docker:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: Checkout
19-
uses: actions/checkout@v2
19+
uses: actions/checkout@v4
2020
- name: Docker meta
2121
id: meta
22-
uses: docker/metadata-action@v3
22+
uses: docker/metadata-action@v5
2323
with:
2424
# list of Docker images to use as base name for tags
2525
images: |
@@ -33,17 +33,29 @@ jobs:
3333
type=semver,pattern={{major}}
3434
type=sha
3535
- name: Set up QEMU
36-
uses: docker/setup-qemu-action@v1
36+
uses: docker/setup-qemu-action@v3
3737
- name: Set up Docker Buildx
38-
uses: docker/setup-buildx-action@v1
38+
uses: docker/setup-buildx-action@v3
3939
- name: Login to GitHub Container Registry
40-
uses: docker/login-action@v1
40+
uses: docker/login-action@v3
4141
with:
4242
registry: ghcr.io
4343
username: ${{ github.repository_owner }}
4444
password: ${{ secrets.GITHUB_TOKEN }}
45-
- name: Build and push
46-
uses: docker/build-push-action@v2
45+
# Build the Docker image for all events, but do not push
46+
# We use linux/amd64 for the build only as it's faster on GitHub Actions
47+
- name: Build image
48+
uses: docker/build-push-action@v5
49+
with:
50+
context: .
51+
platforms: linux/amd64
52+
push: false
53+
tags: ${{ steps.meta.outputs.tags }}
54+
labels: ${{ steps.meta.outputs.labels }}
55+
# Push the Docker image only when a GitHub Release is published
56+
- name: Push image
57+
if: github.event_name == 'release' && github.event.action == 'published'
58+
uses: docker/build-push-action@v5
4759
with:
4860
context: .
4961
platforms: linux/amd64,linux/arm64

go.mod

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,18 @@ require (
99
github.com/go-logr/logr v1.4.2
1010
github.com/onsi/ginkgo/v2 v2.23.4
1111
github.com/onsi/gomega v1.37.0
12-
github.com/stretchr/testify v1.10.0
1312
go.uber.org/zap v1.27.0
1413
gopkg.in/yaml.v3 v3.0.1
1514
k8s.io/api v0.33.0
1615
k8s.io/apimachinery v0.33.0
1716
k8s.io/client-go v0.33.0
17+
k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e
1818
sigs.k8s.io/controller-runtime v0.20.4
1919
)
2020

2121
require (
2222
cel.dev/expr v0.23.1 // indirect
2323
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
24-
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
2524
github.com/beorn7/perks v1.0.1 // indirect
2625
github.com/blang/semver/v4 v4.0.0 // indirect
2726
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
@@ -40,18 +39,14 @@ require (
4039
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
4140
github.com/goccy/go-json v0.10.5 // indirect
4241
github.com/gogo/protobuf v1.3.2 // indirect
43-
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
44-
github.com/golang/protobuf v1.5.4 // indirect
4542
github.com/google/btree v1.1.3 // indirect
4643
github.com/google/cel-go v0.25.0 // indirect
4744
github.com/google/gnostic-models v0.6.9 // indirect
4845
github.com/google/go-cmp v0.7.0 // indirect
4946
github.com/google/go-querystring v1.1.0 // indirect
50-
github.com/google/gofuzz v1.2.0 // indirect
5147
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 // indirect
5248
github.com/google/uuid v1.6.0 // indirect
5349
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect
54-
github.com/imdario/mergo v0.3.16 // indirect
5550
github.com/inconshreveable/mousetrap v1.1.0 // indirect
5651
github.com/josharian/intern v1.0.0 // indirect
5752
github.com/json-iterator/go v1.1.12 // indirect
@@ -96,13 +91,11 @@ require (
9691
google.golang.org/protobuf v1.36.6 // indirect
9792
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
9893
gopkg.in/inf.v0 v0.9.1 // indirect
99-
gopkg.in/yaml.v2 v2.4.0 // indirect
10094
k8s.io/apiextensions-apiserver v0.33.0 // indirect
10195
k8s.io/apiserver v0.33.0 // indirect
10296
k8s.io/component-base v0.33.0 // indirect
10397
k8s.io/klog/v2 v2.130.1 // indirect
10498
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect
105-
k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e // indirect
10699
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.32.0 // indirect
107100
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
108101
sigs.k8s.io/randfill v1.0.0 // indirect

0 commit comments

Comments
 (0)