Push helm charts #855
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and publish services | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
branches: | |
- "*" | |
pull_request: | |
branches: | |
- "*" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Docker Buildx | |
if: ${{ contains(github.event.head_commit.message, 'smoke_test') }} | |
uses: docker/setup-buildx-action@v1 | |
- name: Install Helm | |
uses: azure/setup-helm@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USER }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
octarine-operator | |
flavor: | | |
latest=false | |
tags: | | |
type=semver,pattern={{version}},value=5.8.13 | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
if: ${{ contains(github.event.head_commit.message, 'smoke_test') }} | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.21.4 | |
- name: Setup Operator SDK | |
if: ${{ contains(github.event.head_commit.message, 'smoke_test') }} | |
run: | | |
mkdir /tmp/operator-sdk | |
git clone -b v1.32.0 https://github.com/operator-framework/operator-sdk /tmp/operator-sdk | |
cd /tmp/operator-sdk | |
make install | |
cd - | |
- run: make generate | |
- run: make manifests | |
- run: make test | |
- name: Build and push | |
if: ${{ contains(github.event.head_commit.message, 'smoke_test') }} | |
run: make docker-build docker-push IMG=cbartifactory/${{ steps.meta.outputs.tags }} VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }} | |
- name: Create and push chart | |
run: | | |
VERSION=${{ steps.meta.outputs.tags }} | |
cd ${{ github.workspace }}/charts/cbcontainers-operator/cbcontainers-operator-chart | |
helm package . --version $VERSION --app-version $VERSION | |
helm push *.tgz oci://registry-1.docker.io/cbartifactory | |
cd ${{ github.workspace }}/charts/cbcontainers-agent/cbcontainers-agent-chart | |
helm package . --version $VERSION --app-version $VERSION | |
helm push *.tgz oci://registry-1.docker.io/cbartifactory |