Skip to content

Commit 0a2fdbe

Browse files
Merge pull request #5 from killianmuldoon/pr-fix-helm-versioon
fix: registry for pushing images
2 parents 462e966 + 995fb30 commit 0a2fdbe

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

.github/workflows/build-images.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ on:
1313

1414
env:
1515
REGISTRY: ghcr.io
16-
IMAGE_NAME_UBUNTU: ${{ github.repository }}
17-
IMAGE_NAME_FEDORA: ${{ github.repository }}-fedora
16+
IMAGE_NAME_UBUNTU: ghcr.io/mellanox/ovn-kubernetes-dpf
17+
IMAGE_NAME_FEDORA: ghcr.io/mellanox/ovn-kubernetes-dpf-fedora
1818

1919
jobs:
2020
build-ubuntu:
@@ -58,7 +58,7 @@ jobs:
5858
id: meta
5959
uses: docker/metadata-action@v5
6060
with:
61-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_UBUNTU }}
61+
images: ${{ env.IMAGE_NAME_UBUNTU }}
6262

6363
- name: Build and push Ubuntu image
6464
uses: docker/build-push-action@v5
@@ -67,13 +67,14 @@ jobs:
6767
file: ./Dockerfile.ovn-kubernetes.ubuntu
6868
platforms: linux/amd64,linux/arm64
6969
push: ${{ github.event_name != 'pull_request' }}
70-
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_UBUNTU }}:${{ steps.tag.outputs.tag }}
70+
tags: ${{ env.IMAGE_NAME_UBUNTU }}:${{ steps.tag.outputs.tag }}
7171
labels: ${{ steps.meta.outputs.labels }}
7272
build-args: |
7373
OVN_KUBERNETES_DIR=ovn-kubernetes
7474
BUILDER_IMAGE=quay.io/projectquay/golang:1.24
7575
cache-from: type=gha
7676
cache-to: type=gha,mode=max
77+
provenance: false
7778

7879
build-fedora:
7980
runs-on: ubuntu-latest
@@ -116,7 +117,7 @@ jobs:
116117
id: meta
117118
uses: docker/metadata-action@v5
118119
with:
119-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_FEDORA }}
120+
images: ${{ env.IMAGE_NAME_FEDORA }}
120121

121122
- name: Build and push Fedora image
122123
uses: docker/build-push-action@v5
@@ -125,11 +126,12 @@ jobs:
125126
file: ./Dockerfile.ovn-kubernetes.fedora
126127
platforms: linux/amd64,linux/arm64
127128
push: ${{ github.event_name != 'pull_request' }}
128-
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_FEDORA }}:${{ steps.tag.outputs.tag }}
129+
tags: ${{ env.IMAGE_NAME_FEDORA }}:${{ steps.tag.outputs.tag }}
129130
labels: ${{ steps.meta.outputs.labels }}
130131
build-args: |
131132
OVN_KUBERNETES_DIR=ovn-kubernetes
132133
BUILDER_IMAGE=quay.io/projectquay/golang:1.24
133134
cache-from: type=gha
134135
cache-to: type=gha,mode=max
136+
provenance: false
135137

.github/workflows/publish-helm.yaml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- main
77
tags:
88
- 'v*'
9+
pull_request:
10+
branches:
11+
- main
912
workflow_dispatch:
1013

1114
env:
@@ -35,10 +38,6 @@ jobs:
3538
with:
3639
version: 'latest'
3740

38-
- name: Log in to Container Registry
39-
run: |
40-
echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ${{ env.REGISTRY }} --username ${{ github.actor }} --password-stdin
41-
4241
- name: Determine tag
4342
id: tag
4443
run: |
@@ -49,7 +48,18 @@ jobs:
4948
fi
5049
echo "tag=${TAG}" >> $GITHUB_OUTPUT
5150
51+
- name: Log in to Container Registry
52+
if: github.event_name != 'pull_request'
53+
run: |
54+
echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ${{ env.REGISTRY }} --username ${{ github.actor }} --password-stdin
55+
56+
- name: Build Helm chart
57+
if: github.event_name == 'pull_request'
58+
run: |
59+
make helm-build TAG=${{ steps.tag.outputs.tag }} REGISTRY=ghcr.io/mellanox
60+
5261
- name: Build and publish Helm chart
62+
if: github.event_name != 'pull_request'
5363
run: |
5464
make helm-publish TAG=${{ steps.tag.outputs.tag }} REGISTRY=ghcr.io/mellanox
5565

0 commit comments

Comments
 (0)