Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Commit d41d879

Browse files
authored
Merge pull request #580 from cprivitere/registries
✨ Refactor release ci and go back to using quay as default
2 parents d6e9a43 + 6e6bfac commit d41d879

File tree

4 files changed

+64
-62
lines changed

4 files changed

+64
-62
lines changed

.github/workflows/ci.yaml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ env:
1414
GHCR_REGISTRY: ghcr.io/${{ github.repository_owner }}
1515
DOCKER_REGISTRY: ${{ secrets.DOCKER_ORG }}
1616
QUAY_REGISTRY: quay.io/${{ secrets.QUAY_ORG }}
17-
REGISTRY: ghcr.io/${{ github.repository_owner }}
18-
17+
REGISTRY: ${{ env.QUAY_REGISTRY }}
1918

2019
jobs:
2120
validate:
@@ -91,7 +90,10 @@ jobs:
9190
id: docker_meta
9291
uses: docker/metadata-action@v4
9392
with:
94-
images: ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}
93+
images: |
94+
${{ env.QUAY_REGISTRY }}/${{ env.IMAGE_NAME }}
95+
${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}
96+
${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}
9597
flavor: |
9698
latest=false
9799
tags: |
@@ -103,7 +105,7 @@ jobs:
103105
type=ref,event=pr
104106
type=sha,priority=1001
105107
106-
- name: Docker Build and Push to GHCR
108+
- name: Docker Build and Push
107109
uses: docker/build-push-action@v4
108110
with:
109111
context: .
@@ -196,7 +198,7 @@ jobs:
196198
path: out/release
197199

198200
- name: Prepull the pre-built image
199-
run: docker pull ${GHCR_REGISTRY}/${IMAGE_NAME}:${TAG}
201+
run: docker pull ${REGISTRY}/${IMAGE_NAME}:${TAG}
200202

201203
- name: "e2e-quickstart"
202204
env:
@@ -243,7 +245,7 @@ jobs:
243245
path: out/release
244246

245247
- name: Prepull the pre-built image
246-
run: docker pull ${GHCR_REGISTRY}/${IMAGE_NAME}:${TAG}
248+
run: docker pull ${REGISTRY}/${IMAGE_NAME}:${TAG}
247249

248250
- name: "e2e"
249251
env:
@@ -290,7 +292,7 @@ jobs:
290292
path: out/release
291293

292294
- name: Prepull the pre-built image
293-
run: docker pull ${GHCR_REGISTRY}/${IMAGE_NAME}:${TAG}
295+
run: docker pull ${REGISTRY}/${IMAGE_NAME}:${TAG}
294296

295297
- name: "e2e-conformance"
296298
env:
@@ -337,7 +339,7 @@ jobs:
337339
path: out/release
338340

339341
- name: Prepull the pre-built image
340-
run: docker pull ${GHCR_REGISTRY}/${IMAGE_NAME}:${TAG}
342+
run: docker pull ${REGISTRY}/${IMAGE_NAME}:${TAG}
341343

342344
- name: "e2e-management-upgrade"
343345
env:
@@ -385,7 +387,7 @@ jobs:
385387
path: out/release
386388

387389
- name: Prepull the pre-built image
388-
run: docker pull ${GHCR_REGISTRY}/${IMAGE_NAME}:${TAG}
390+
run: docker pull ${REGISTRY}/${IMAGE_NAME}:${TAG}
389391

390392
- name: "e2e-workload-upgrade"
391393
env:

.github/workflows/release.yaml

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,29 @@ env:
99
GHCR_REGISTRY: ghcr.io/${{ github.repository_owner }}
1010
DOCKER_REGISTRY: ${{ secrets.DOCKER_ORG }}
1111
QUAY_REGISTRY: quay.io/${{ secrets.QUAY_ORG }}
12-
REGISTRY: quay.io/${{ secrets.QUAY_ORG }}
13-
metadata_flavor: latest=false
14-
metadata_tags: type=ref,event=tag
12+
REGISTRY: ${{ env.QUAY_REGISTRY }}
13+
1514
jobs:
16-
manager-image:
17-
name: Build and push manager image
15+
16+
build-image:
17+
name: Build and Push Image
1818
runs-on: ubuntu-latest
19+
20+
permissions:
21+
packages: write # needed to push docker image to ghcr.io
22+
1923
steps:
20-
- name: Checkout code
24+
25+
- name: Checkout git repo
2126
uses: actions/checkout@v3
22-
with:
23-
fetch-depth: 0
24-
- uses: actions/setup-go@v4
25-
with:
26-
go-version-file: './go.mod'
27+
2728
- name: Set up QEMU
2829
uses: docker/setup-qemu-action@v2
30+
2931
- name: Set up Docker Buildx
3032
uses: docker/setup-buildx-action@v2
3133

32-
- name: Generate metadata
33-
id: meta
34-
uses: ./.github/actions/metadata
35-
with:
36-
docker_username: ${{ secrets.DOCKER_USERNAME }}
37-
quay_username: ${{ secrets.QUAY_USERNAME }}
38-
metadata_flavor: ${{ env.metadata_flavor }}
39-
metadata_tags: ${{ env.metadata_tags }}
40-
41-
- name: Log in to ghcr.io
34+
- name: Login to ghcr.io registry
4235
uses: docker/login-action@v2
4336
with:
4437
registry: ghcr.io
@@ -64,58 +57,64 @@ jobs:
6457
username: ${{ secrets.QUAY_USERNAME }}
6558
password: ${{ secrets.QUAY_PASSWORD }}
6659

60+
- name: Docker meta
61+
id: docker_meta
62+
uses: docker/metadata-action@v4
63+
with:
64+
images: |
65+
${{ env.QUAY_REGISTRY }}/${{ env.IMAGE_NAME }}
66+
${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}
67+
${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}
68+
flavor: |
69+
latest=auto
70+
tags: |
71+
type=semver,pattern={{version}}
72+
type=ref,event=branch
73+
type=ref,event=tag
74+
type=ref,event=pr
75+
type=sha
76+
6777
- name: Setup Env
6878
run: |
6979
DOCKER_BUILD_LDFLAGS="$(hack/version.sh)"
7080
echo 'DOCKER_BUILD_LDFLAGS<<EOF' >> $GITHUB_ENV
7181
echo $DOCKER_BUILD_LDFLAGS >> $GITHUB_ENV
7282
echo 'EOF' >> $GITHUB_ENV
7383
74-
- name: Build and push manager image
84+
- name: Docker Build and Push
7585
uses: docker/build-push-action@v4
7686
with:
7787
context: .
7888
push: true
7989
build-args: |
8090
LDFLAGS=${{ env.DOCKER_BUILD_LDFLAGS }}
81-
tags: ${{ steps.meta.outputs.tags }}
82-
labels: ${{ steps.meta.outputs.labels }}
83-
platforms: linux/amd64,linux/arm64
84-
cache-from: type=gha, scope=${{ github.workflow }}
85-
cache-to: type=gha, mode=max, scope=${{ github.workflow }}
91+
tags: ${{ steps.docker_meta.outputs.tags }}
92+
labels: ${{ steps.docker_meta.outpus.labels }}
93+
cache-from: type=gha
94+
cache-to: type=gha,mode=max
95+
platforms: linux/amd64, linux/arm64, linux/arm/v7
96+
97+
outputs:
98+
image-tag: "${{ steps.docker_meta.outputs.version }}"
8699

87100
release:
88-
name: Release
101+
name: Create Release
89102
runs-on: ubuntu-latest
90-
needs:
91-
- manager-image
103+
needs: [build-image]
104+
env:
105+
TAG: ${{ needs.build-image.outputs.image-tag }}
106+
92107
steps:
93-
- name: Checkout code
108+
109+
- name: checkout
94110
uses: actions/checkout@v3
111+
95112
- uses: actions/setup-go@v4
96113
with:
97114
go-version-file: './go.mod'
98-
- uses: actions/cache@v3
99-
with:
100-
path: hack/tools/bin
101-
key: ${{ runner.os }}-tools-bin-release-${{ hashFiles('Makefile') }}
102-
restore-keys: |
103-
${{ runner.os }}-tools-bin-release-
104-
${{ runner.os }}-tools-bin-
105-
106-
- name: Generate metadata
107-
id: meta
108-
uses: ./.github/actions/metadata
109-
with:
110-
docker_username: ${{ secrets.DOCKER_USERNAME }}
111-
quay_username: ${{ secrets.QUAY_USERNAME }}
112-
metadata_flavor: ${{ env.metadata_flavor }}
113-
metadata_tags: ${{ env.metadata_tags }}
114115

115-
- name: manifest
116+
- name: Make Release
116117
run: make release
117-
env:
118-
TAG: ${{ steps.meta.outputs.version }}
119118

120119
- name: Generate Release Notes
121120
run: |
@@ -127,11 +126,12 @@ jobs:
127126
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
128127
OWNER: ${{ github.repository_owner }}
129128
REPO: ${{ github.event.repository.name }}
129+
130130
- name: Create Release
131131
uses: softprops/action-gh-release@v1
132132
if: startsWith(github.ref, 'refs/tags/')
133133
with:
134134
files: out/release/*
135135
body: ${{ env.RELEASE_NOTES }}
136136
draft: false
137-
prerelease: false
137+
prerelease: false

test/e2e/config/packet-ci-actions.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# - packet
77

88
images:
9-
- name: "${REGISTRY:=ghcr.io/kubernetes-sigs}/${IMAGE_NAME:=cluster-api-provider-packet}:${TAG:=e2e}"
9+
- name: "${REGISTRY:=quay.io/kubernetes-sigs}/${IMAGE_NAME:=cluster-api-provider-packet}:${TAG:=e2e}"
1010
loadBehavior: mustLoad
1111

1212
providers:

test/e2e/config/packet-ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# - packet
77

88
images:
9-
- name: "${REGISTRY:=ghcr.io/kubernetes-sigs}/${IMAGE_NAME:=cluster-api-provider-packet}:${TAG:=e2e}"
9+
- name: "${REGISTRY:=quay.io/kubernetes-sigs}/${IMAGE_NAME:=cluster-api-provider-packet}:${TAG:=e2e}"
1010
loadBehavior: mustLoad
1111

1212
providers:

0 commit comments

Comments
 (0)