Skip to content

Commit

Permalink
Add Helm linting and publishing CI
Browse files Browse the repository at this point in the history
  • Loading branch information
callumforrester committed Jul 19, 2024
1 parent c1e908d commit f680bab
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 1 deletion.
65 changes: 65 additions & 0 deletions .github/workflows/helm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Helm CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
GCR_IMAGE: ghcr.io/diamondlightsource/logpanel
HELM_VERSION: 3.12.3
HELM_CHART: helm/logpanel

jobs:
check:
name: check helm chart
runs-on: ubuntu-latest
# environment: prod
steps:
- name: checkout repo
uses: actions/checkout@v3

- name: install helm
uses: Azure/setup-helm@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
id: install

- name: check chart
run: helm lint ${{ env.HELM_CHART }}

- name: check depdencies
run: helm dependencies build ${{ env.HELM_CHART }}

build:
if: github.ref_type == 'tag'
name: publish gcr
runs-on: ubuntu-latest
# environment: prod
steps:
- name: checkout repo
uses: actions/checkout@v3

- name: install helm
uses: Azure/setup-helm@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
id: install

- name: login to acr using helm
run: |
echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ${{ env.GCR_IMAGE }} --username ${{ github.repository_owner }} --password-stdin
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@57396166ad8aefe6098280995947635806a0e6ea
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=tag
- name: package chart and push it
run: |
sed -i "$ a appVersion: ${GITHUB_REF##*/}" ${{ env.HELM_CHART }}/Chart.yaml
helm dependencies build ${{ env.HELM_CHART }}
helm package ${{ env.HELM_CHART }} --version ${GITHUB_REF##*/} -d /tmp/
helm push /tmp/blueapi-${GITHUB_REF##*/}.tgz oci://ghcr.io/diamondlightsource/charts
1 change: 0 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:

jobs:
build:

runs-on: ubuntu-latest

strategy:
Expand Down

0 comments on commit f680bab

Please sign in to comment.