Skip to content

Merge pull request #333 from cloudability/CLDYCON-7030 #194

Merge pull request #333 from cloudability/CLDYCON-7030

Merge pull request #333 from cloudability/CLDYCON-7030 #194

Workflow file for this run

name: Deploy
on:
push:
paths:
- 'version/version.go'
jobs:
deploy:
name: Build and Deploy
# only build/deploy for beta and master branches
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/beta'
runs-on: ubuntu-22.04
steps:
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: actions/setup-go@v2
with:
go-version: '1.24'
- uses: actions/checkout@v2
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Docker Build Master and Push
# If pushing to the master branch, we want to correctly tag the builds
# in docker-hub with the new master makefile command
if: github.ref == 'refs/heads/master'
run: make container-build-master
- name: Docker Build Beta and Push
# If pushing to the beta branch, we want to correctly tag the builds
# in docker-hub with the new beta makefile command
if: github.ref == 'refs/heads/beta'
run: make container-build-beta
helmRelease:
name: Cut Helm Release when Updated
needs: deploy
runs-on: ubuntu-latest
# Only cut release if pushing to master
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Cosign
uses: sigstore/cosign-installer@v3.9.2
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Run chart-releaser
run: |
export CR_TOKEN="${{ secrets.GITHUB_TOKEN }}"
owner=$(cut -d '/' -f 1 <<< "$GITHUB_REPOSITORY")
repo=$(cut -d '/' -f 2 <<< "$GITHUB_REPOSITORY")
release=1.8.1
filename=chart-releaser_1.8.1_linux_amd64.tar.gz
wget https://github.com/helm/chart-releaser/releases/download/v${release}/${filename}
cosign verify-blob --certificate-oidc-issuer "https://token.actions.githubusercontent.com" --certificate-identity https://github.com/helm/chart-releaser/.github/workflows/release.yaml@refs/tags/v${release} --cert https://github.com/helm/chart-releaser/releases/download/v${release}/${filename}.pem --signature https://github.com/helm/chart-releaser/releases/download/v${release}/${filename}.sig $filename
tar -xf $filename cr
./cr package charts/metrics-agent
./cr upload --owner "$owner" --git-repo "$repo" --packages-with-index --push --skip-existing
./cr index --owner "$owner" --git-repo "$repo" --packages-with-index --index-path . --push