Skip to content

Commit

Permalink
Add github runner for helm chart releaser
Browse files Browse the repository at this point in the history
  • Loading branch information
jakeschuurmans committed Sep 30, 2024
1 parent 0aa5d6a commit 36cd6df
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 3 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/chart-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Release Charts

on:
push:
tags:
- 'v*.*.*'

jobs:
build:
name: Publish Helm Chart
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
env:
CHART_NAME: bioscfg
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
path: ${{ env.CHART_NAME }}
fetch-depth: 0
-
name: Checkout Helm chart Repo
uses: actions/checkout@v4
with:
repository: metal-toolbox/${{ env.CHART_NAME }}
path: helm-charts
ref: gh-pages
fetch-depth: 0
-
name: Install Helm
uses: azure/[email protected]
-
name: Package Helm Chart
run: |
helm package --version ${{ github.ref_name }} ./${{ env.CHART_NAME }}/chart -u -d ./helm-charts/
helm repo index ./helm-charts/ --url https://metal-toolbox.github.io/${{ env.CHART_NAME }}/
-
name: Create Git Commit
run: |
cd helm-charts
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
git add index.yaml *.tgz
git commit -m "published ${{ env.CHART_NAME }}-${{ github.ref_name }}.tgz"
-
name: Push Changes
uses: ad-m/github-push-action@master
with:
repository: metal-toolbox/${{ env.CHART_NAME }}
directory: helm-charts
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/jeremywohl/flatten v1.0.1
github.com/metal-toolbox/ctrl v0.2.9
github.com/metal-toolbox/fleetdb v1.19.5
github.com/metal-toolbox/rivets v1.3.9-0.20240930172024-b54836e2f7ec
github.com/metal-toolbox/rivets v1.3.9-0.20240930173434-4b2948033ed7
github.com/mitchellh/copystructure v1.2.0
github.com/mitchellh/mapstructure v1.5.0
github.com/pkg/errors v0.9.1
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,10 @@ github.com/metal-toolbox/rivets v1.3.9-0.20240930171923-6b6ce41dd113 h1:N4OnmHlO
github.com/metal-toolbox/rivets v1.3.9-0.20240930171923-6b6ce41dd113/go.mod h1:yxvMwsGL8LsEWL5eBq17ViEvULVOojl+vIcGcz+YTzE=
github.com/metal-toolbox/rivets v1.3.9-0.20240930172024-b54836e2f7ec h1:k/MCL5iD7ZBqi/zLla/PQ8kk85Pejox3XUoia8py75s=
github.com/metal-toolbox/rivets v1.3.9-0.20240930172024-b54836e2f7ec/go.mod h1:yxvMwsGL8LsEWL5eBq17ViEvULVOojl+vIcGcz+YTzE=
github.com/metal-toolbox/rivets v1.3.9-0.20240930173320-bdda49e6a58c h1:RPtkn3yYJiSfxpLytcfAACJdCxrsB0MRA6HkiUudWEI=
github.com/metal-toolbox/rivets v1.3.9-0.20240930173320-bdda49e6a58c/go.mod h1:yxvMwsGL8LsEWL5eBq17ViEvULVOojl+vIcGcz+YTzE=
github.com/metal-toolbox/rivets v1.3.9-0.20240930173434-4b2948033ed7 h1:od35ywiEtk3tFfwSe64RHwMnpmdBt5jQd3UTbYfF2Yg=
github.com/metal-toolbox/rivets v1.3.9-0.20240930173434-4b2948033ed7/go.mod h1:yxvMwsGL8LsEWL5eBq17ViEvULVOojl+vIcGcz+YTzE=
github.com/microsoft/go-mssqldb v0.17.0/go.mod h1:OkoNGhGEs8EZqchVTtochlXruEhEOaO4S0d2sB5aeGQ=
github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso=
github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI=
Expand Down
4 changes: 2 additions & 2 deletions internal/bioscfg/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ func (th *TaskHandler) Run(ctx context.Context) error {
}

switch th.task.Parameters.Action {
case rctypes.ResetBiosConfig:
case rctypes.ResetConfig:
return th.ResetBiosConfig(ctx)
case rctypes.SetBiosConfig:
case rctypes.SetConfig:
return th.SetBiosConfig(ctx)
default:
return th.failedWithError(ctx, string(th.task.Parameters.Action), errUnsupportedAction)
Expand Down

0 comments on commit 36cd6df

Please sign in to comment.