Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cd): added chart release workflow #2

Merged
merged 1 commit into from
Nov 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/configs/cr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## Reference: https://github.com/helm/chart-releaser
index-path: "./index.yaml"

# Enable automatic generation of release notes using GitHubs release notes generator.
# see: https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes
generate-release-notes: true
File renamed without changes.
62 changes: 62 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
## Reference: https://github.com/helm/chart-releaser-action
name: Chart Publish
on:
push:
branches:
- main
paths:
- "charts/**"

permissions:
contents: read

jobs:
publish:
permissions:
contents: write # for helm/chart-releaser-action to push chart release and create a release
packages: write # to push OCI chart package to GitHub Registry
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: Install Helm
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
with:
version: v3.10.1 # Also update in lint-and-test.yaml

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
## This is required to consider the old Circle-CI Index and to stay compatible with all the old releases.
- name: Fetch current Chart Index
run: |
git checkout origin/gh-pages index.yaml
- name: Run chart-releaser
uses: helm/chart-releaser-action@a917fd15b20e8b64b94d9158ad54cd6345335584 # v1.6.0
with:
config: "./.github/configs/cr.yaml"
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

- name: Login to GHCR
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push chart to GHCR
run: |
shopt -s nullglob
for pkg in .cr-release-packages/*.tgz; do
if [ -z "${pkg:-}" ]; then
break
fi
helm push "${pkg}" oci://ghcr.io/${{ github.repository }}
done
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 "CARDONNE Thomas"

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
56 changes: 10 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
# Helm Chart for General Purpose Application Deployment
# Browol Helm Charts

[![Chart Publish](https://github.com/browol/helm-charts/actions/workflows/release.yml/badge.svg?branch=main)](https://github.com/browol/helm-charts/actions/workflows/release.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## Introduction

This repository contains a collection of Helm charts for deploying and managing various applications on Kubernetes.

## Usage

### Installing a Chart
### Add Helm Repository

To install a chart from this repository, first add the repository to your Helm client:

```bash
helm repo add browol https://github.com/browol/helm-charts.git
helm repo add browol https://browol.github.io/helm-charts
helm repo update
```

Once the repository is added, you can install a chart using its name:
Expand All @@ -20,50 +24,10 @@ Once the repository is added, you can install a chart using its name:
helm install browol/general-purpose
```

Replace `<chart-name>` with the name of the chart you want to install.

### Updating a Chart

To update an existing chart, first upgrade your Helm client:

```bash
helm upgrade --install browol/general-purpose
```

Replace `<chart-name>` with the name of the chart you want to update.

### Releasing a New Chart Version

1. Bump the chart version in `Chart.yaml`:

```yaml
version: <chart-version> # <<<< Bump version here
```

2. Lint the chart:

```bash
helm lint ./
```

3. Create the Helm chart package:

```bash
helm package ./ -d packages/
```

4. Update the Helm chart repository index:

```bash
helm repo index --url ./ --merge index.yaml ./
```
### Installing a Specific Chart Version

5. Push the changes to the git repository on GitHub:
To install a specific version of a chart, use the `--version` flag:

```bash
git add . && \
git commit -m "your commit message" && \
git push origin main && \
git tag -f v<chart-version> $(git rev-parse --short HEAD) && \
git push --tags -f
helm install browol/general-purpose --version 0.2.10
```