mirror of
https://github.com/YuzuZensai/netbird-kubernetes-operator.git
synced 2026-09-13 10:49:15 +00:00
Rename Helm chart and Docker image and move to GHCR (#233)
This change does a few things, none of these are breaking. It changes the registry from Docker Hub to GHCR, as we dont have the same rate limiting issues with unauthenticated pulls. It changes the release process to push the Helm chart as an OCI artifact removing the need for GH pages. It renames both the image and chart from kubernetes-operator to netbird-operator. This name is cleaner and easier for people to understand in a sea of Helm charts. Funnily enough this is not a breaking change as the release name is used and not the chart name. So in place upgrades just work. Fixes #207 Signed-off-by: Philip Laine <philip.laine@gmail.com>
This commit is contained in:
@@ -8,4 +8,4 @@ jobs:
|
||||
- name: Clone the code
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
|
||||
- name: Lint Helm Chart
|
||||
run: helm lint ./helm/kubernetes-operator
|
||||
run: helm lint ./charts/netbird-operator
|
||||
|
||||
@@ -3,15 +3,16 @@ on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
branches:
|
||||
- main
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
id-token: write
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
jobs:
|
||||
docker:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
id-token: write
|
||||
steps:
|
||||
- name: Clone the code
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
|
||||
@@ -19,23 +20,41 @@ jobs:
|
||||
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c #v6.4.0
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
- name: Set up Docker
|
||||
uses: docker/setup-docker-action@b2189fbf2a6592b51fee7cdd93ee2bfaeba733db #v5.1.0
|
||||
with:
|
||||
daemon-config: |
|
||||
{
|
||||
"features": {
|
||||
"containerd-snapshotter": true
|
||||
}
|
||||
}
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd #v4.0.0
|
||||
- name: Login to Docker Hub
|
||||
with:
|
||||
driver: docker
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 #v4.1.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USER }}
|
||||
password: ${{ secrets.DOCKER_TOKEN }}
|
||||
- name: Build image
|
||||
id: build
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Prepare versions
|
||||
id: prep
|
||||
run: |
|
||||
IMG_TAG="${GITHUB_REF_NAME}"
|
||||
if [[ "${{ github.ref_type }}" == "tag" ]]; then
|
||||
IMG_TAG="${GITHUB_REF_NAME#v}"
|
||||
HELM_VERSION=${GITHUB_REF_NAME#v}
|
||||
else
|
||||
IMG_TAG="${GITHUB_SHA::7}"
|
||||
HELM_VERSION="0.0.0-${GITHUB_REF_NAME}"
|
||||
fi
|
||||
IMG=$(make build-image-multiarch) || exit 1
|
||||
echo "IMG=${IMG}" >> $GITHUB_OUTPUT
|
||||
- name: Push image
|
||||
echo "IMG_TAG=${IMG_TAG}" >> $GITHUB_OUTPUT
|
||||
echo "HELM_VERSION=${HELM_VERSION}" >> $GITHUB_OUTPUT
|
||||
- name: Build and push image
|
||||
run: |
|
||||
docker push ${{ steps.build.outputs.IMG }}
|
||||
IMG_REF=$(make build-image-multiarch IMG_REPOSITORY=${{ github.repository_owner }}/netbird-operator IMG_TAG=${{ steps.prep.outputs.IMG_TAG }}) || exit 1
|
||||
docker push ${IMG_REF}
|
||||
- name: Build and push Helm chart
|
||||
run: |
|
||||
helm package --app-version ${{ steps.prep.outputs.IMG_TAG }} --version ${{ steps.prep.outputs.HELM_VERSION }} charts/netbird-operator
|
||||
helm push netbird-operator-${{ steps.prep.outputs.HELM_VERSION }}.tgz oci://ghcr.io/${{ github.repository_owner }}/helm-charts
|
||||
|
||||
Reference in New Issue
Block a user