Skip to content

feat(helm-chart): add annotations and labels to resources (#51) #14

feat(helm-chart): add annotations and labels to resources (#51)

feat(helm-chart): add annotations and labels to resources (#51) #14

Workflow file for this run

name: Release
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
env:
HELM_REP: helm-charts
GH_OWNER: komodorio
CHART_DIR: charts/komoplane
jobs:
pre_release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get tag name
id: get_tag_name
run: echo "TAG_NAME=$(echo ${{ github.ref_name }} | cut -d 'v' -f2)" >> $GITHUB_OUTPUT
outputs:
release_tag: ${{ steps.get_tag_name.outputs.TAG_NAME }}
release:
needs: pre_release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# Node part
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
cache: 'npm'
cache-dependency-path: pkg/frontend/package-lock.json
- name: NPM install
run: npm i
working-directory: ./pkg/frontend
- name: NPM build
run: npm run build
working-directory: ./pkg/frontend
# Golang part
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
image:
runs-on: ubuntu-latest
needs: [ release, pre_release ]
timeout-minutes: 60
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Docker meta
uses: docker/metadata-action@v4
id: meta
with:
images: komodorio/komoplane
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
if: github.event_name != 'pull_request'
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASS }}
- name: Build and push
uses: docker/build-push-action@v4
if: github.event_name != 'pull_request'
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: komodorio/komoplane:${{ needs.pre_release.outputs.release_tag }},komodorio/komoplane:latest
labels: ${{ steps.meta.outputs.labels }}
build-args: VER=${{ needs.pre_release.outputs.release_tag }}
platforms: linux/amd64,linux/arm64
publish_chart:
runs-on: ubuntu-latest
needs: [ image, pre_release ]
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Bump versions
run: |
git config user.email komi@komodor.io
git config user.name komodor-bot
git fetch --tags
git checkout main
sh ./.github/workflows/bump-versions.sh
git add charts/komoplane/Chart.yaml
git commit -m "Increment chart versions [skip ci]" || echo "Already up-to-date"
git push -f || echo "Nothing to push!"
env:
APP_VERSION: ${{ needs.pre_release.outputs.release_tag }}
- name: Push folder to helm-charts repository
uses: crykn/copy_folder_to_another_repo_action@v1.0.6
env:
API_TOKEN_GITHUB: ${{ secrets.KOMI_WORKFLOW_TOKEN }}
with:
source_folder: "charts/komoplane"
destination_repo: "komodorio/helm-charts"
destination_folder: "charts/komoplane"
user_email: "komi@komodor.io"
user_name: "komodor-bot"
destination_branch: "master"
commit_msg: "feat(OSS komoplane): ${{ github.event.head_commit.message }}" #important!! don't change this commit message unless you change the condition in pipeline.yml on helm-charts repo