Skip to content

Commit

Permalink
improved github actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
zackbradys committed Feb 11, 2024
1 parent 54e8381 commit bca4549
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
27 changes: 17 additions & 10 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Helm Chart Release
name: Release Helm Chart(s)
on:
push:
branches:
Expand All @@ -18,16 +18,23 @@ jobs:
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Helm Chart Releaser
- name: Run Helm Chart Releaser
uses: helm/chart-releaser-action@v1.5.0
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}'

- name: Build and Push Helm Chart
- name: Authenticate to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push Chart(s) to GHCR
run: |
cd charts/cluster-templates
helm package .
ls -la
echo ${{ secrets.GHCR_TOKEN }} | docker login ghcr.io -u rancherfederal --password-stdin
export CHART_VERSION=$(grep 'version:' Chart.yaml | tail -n1 | awk '{ print $2}')
helm push rancher-cluster-templates-${CHART_VERSION}.tgz oci://ghcr.io/rancherfederal
for pkg in .cr-release-packages/*; do
if [ -z "${pkg:-}" ]; then
break
fi
helm push "${pkg}" oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/charts
done
2 changes: 1 addition & 1 deletion charts/cluster-templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ helm upgrade -i cluster cluster-templates/rancher-cluster-templates -n fleet-def
```

```bash
helm upgrade -i cluster oci://ghcr.io/rancherfederal/rancher-cluster-templates -n fleet-default -f values.yaml
helm upgrade -i cluster oci://ghcr.io/rancherfederal/charts/rancher-cluster-templates -n fleet-default -f values.yaml
```

## Helm Chart Deployment Status
Expand Down
2 changes: 1 addition & 1 deletion charts/cluster-templates/app-readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ helm upgrade -i cluster cluster-templates/rancher-cluster-templates -n fleet-def
```

```bash
helm upgrade -i cluster oci://ghcr.io/rancherfederal/rancher-cluster-templates -n fleet-default -f values.yaml
helm upgrade -i cluster oci://ghcr.io/rancherfederal/charts/rancher-cluster-templates -n fleet-default -f values.yaml
```

## Helm Chart Deployment Status
Expand Down

0 comments on commit bca4549

Please sign in to comment.