-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new way to publish new helm chart versions
- Loading branch information
Showing
3 changed files
with
53 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
name: Helm publish on new commit and new version | ||
name: Helm publish new version | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
- '!gh-pages' | ||
|
||
jobs: | ||
chart-publish: | ||
|
@@ -20,43 +19,33 @@ jobs: | |
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
- name: Helm Installation | ||
uses: azure/setup-helm@v3 | ||
- name: Set up Helm | ||
uses: azure/setup-helm@v4 | ||
with: | ||
version: v3.12.0 | ||
|
||
- name: Run chart-releaser for publish on new version | ||
if: github.ref == 'refs/heads/main' | ||
uses: helm/chart-releaser-action@main | ||
- name: Run chart-releaser | ||
uses: helm/[email protected] | ||
with: | ||
charts_dir: '.' | ||
charts_dir: . | ||
config: cr.yaml | ||
env: | ||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
CR_SKIP_EXISTING: "true" | ||
|
||
- name: Checkout gh-pages branch | ||
uses: actions/checkout@v3 | ||
- name: Login to GHCR | ||
uses: docker/login-action@v3 | ||
with: | ||
fetch-depth: 0 | ||
ref: 'gh-pages' | ||
path: gh-pages | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Helm Package all the charts using commit ID and remove chart packages older than 6 months | ||
shell: bash | ||
- name: Push charts to GHCR | ||
run: | | ||
mv gh-pages /tmp/gh-pages | ||
for directory in *; do | ||
if [ -d "$directory" ]; then | ||
helm package "$directory" -d /tmp/gh-pages --version $(helm show chart "$directory" |grep ^version: | awk '{print $2}')-"$GITHUB_REF_NAME"-"${GITHUB_SHA::7}" | ||
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_OWNER}/helm-charts" | ||
done | ||
cd /tmp/gh-pages | ||
find . -type f -mtime +180 -delete | ||
helm repo index . --merge index.yaml | ||
cd $GITHUB_WORKSPACE | ||
mv /tmp/gh-pages . | ||
- name: Deploy to GitHub Pages the charts based on the commit ID | ||
uses: crazy-max/ghaction-github-pages@v3 | ||
with: | ||
target_branch: gh-pages | ||
build_dir: gh-pages | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# WARNING: New location storage for the helm chart | ||
|
||
All the helm chart are now stored inside the GitHub Docker registry. | ||
|
||
Please use it like so: | ||
|
||
## For helmfile.yaml | ||
|
||
``` | ||
chart: oci://ghcr.io/camptocamp/charts-gs/myhelmchart | ||
version: X.X.X | ||
``` | ||
|
||
You don't need to include this anymore: | ||
``` | ||
repositories: | ||
- name: charts-gs | ||
url: https://camptocamp.github.io/charts-gs/ | ||
``` | ||
|
||
Make sure to migrate to this new way of working. | ||
|
||
## When installing manually | ||
|
||
``` | ||
helm install myapp oci://ghcr.io/camptocamp/charts-gs/myhelmchart --version X.X.X | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
sign: false | ||
|
||
# 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 |