Skip to content

Commit ef25e4f

Browse files
committed
github: update actions and trigger builds on pull reqs
1 parent 10784e1 commit ef25e4f

2 files changed

Lines changed: 47 additions & 17 deletions

File tree

.github/workflows/build-cloud-controller-manager.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,32 @@ on:
33
push:
44
tags:
55
- '*'
6+
67
jobs:
78
build:
89
runs-on: ubuntu-latest
910
steps:
10-
-
11-
name: Set up Docker Buildx
12-
uses: docker/setup-buildx-action@v2
13-
-
14-
name: Set up Docker Metadata
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
- name: Set up Docker Buildx
14+
uses: docker/setup-buildx-action@v3
15+
- name: Set up Docker Metadata
1516
id: meta
16-
uses: docker/metadata-action@v4
17+
uses: docker/metadata-action@v5
1718
with:
1819
images: |
1920
cr.brightbox.com/${{ vars.CR_ACCOUNT }}/${{ vars.CR_REPO }}/brightbox-cloud-controller-manager
2021
tags: |
2122
type=semver,pattern={{version}}
22-
-
23-
name: Login to Brightbox Container Registry
24-
uses: docker/login-action@v2
23+
type=ref,event=pr
24+
- name: Login to Brightbox Container Registry
25+
uses: docker/login-action@v3
2526
with:
2627
registry: cr.brightbox.com
2728
username: ${{ vars.CR_USERNAME }}
2829
password: ${{ secrets.CR_SECRET }}
29-
-
30-
name: Docker build and push
31-
uses: docker/build-push-action@v4
30+
- name: Docker build and push
31+
uses: docker/build-push-action@v6
3232
with:
3333
tags: ${{ steps.meta.outputs.tags }}
3434
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/test-prs.yaml

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,45 @@
1-
name: "Test Pull Requests"
1+
name: "Test And Build Pull Requests"
22

3-
on:
3+
on:
44
pull_request:
55

66
jobs:
77
test:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v3
11-
- uses: actions/setup-go@v4
10+
- uses: actions/checkout@v4
11+
- uses: actions/setup-go@v5
1212
with:
1313
go-version-file: go.mod
14+
cache: true
1415
- name: Test
15-
uses: robherley/go-test-action@v0.1.0
16+
uses: robherley/go-test-action@v0.7.1
17+
build:
18+
runs-on: ubuntu-latest
19+
needs: test
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v3
24+
- name: Set up Docker Metadata
25+
id: meta
26+
uses: docker/metadata-action@v5
27+
with:
28+
images: |
29+
cr.brightbox.com/${{ vars.CR_ACCOUNT }}/${{ vars.CR_REPO }}/brightbox-cloud-controller-manager
30+
tags: |
31+
type=ref,event=pr
32+
- name: Login to Brightbox Container Registry
33+
uses: docker/login-action@v3
34+
with:
35+
registry: cr.brightbox.com
36+
username: ${{ vars.CR_USERNAME }}
37+
password: ${{ secrets.CR_SECRET }}
38+
- name: Docker build and push
39+
uses: docker/build-push-action@v6
40+
with:
41+
tags: ${{ steps.meta.outputs.tags }}
42+
labels: ${{ steps.meta.outputs.labels }}
43+
push: true
44+
cache-from: type=gha
45+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)