Merge pull request #7 from mkilchhofer/feature/ingressClassName #12
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
## Reference: https://github.com/helm/chart-releaser-action | |
name: Chart Publish | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "charts/**" | |
workflow_dispatch: {} | |
permissions: | |
contents: read | |
env: | |
CR_VERSION: "1.6.1" | |
CR_SHASUM: "d4a2ffa825ff1b60a1cce819ce87eec337cf16059ca3d8a053e20cac39cf9e0a" | |
HELM_REPO: unifi-chart | |
jobs: | |
publish: | |
if: github.repository == 'mkilchhofer/unifi-chart' | |
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@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 | |
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 "[email protected]" | |
- name: Install chart-releaser | |
run: | | |
wget https://github.com/helm/chart-releaser/releases/download/v${{ env.CR_VERSION }}/chart-releaser_${{ env.CR_VERSION }}_linux_amd64.tar.gz | |
echo "${{ env.CR_SHASUM }} chart-releaser_${{ env.CR_VERSION }}_linux_amd64.tar.gz" | sha256sum -c - | |
tar xzvf chart-releaser_${{ env.CR_VERSION }}_linux_amd64.tar.gz cr | |
- name: Package helm chart | |
run: | | |
./cr package charts/unifi --config ./.github/configs/cr.yaml | |
# Classic helm repository with GitHub pages | |
- name: Upload helm chart | |
run: | | |
./cr upload -o ${GITHUB_REPOSITORY_OWNER} -r ${{ env.HELM_REPO }} --token ${{ secrets.GITHUB_TOKEN }} --commit $(git rev-parse HEAD) --config ./.github/configs/cr.yaml | |
- name: Login to GHCR | |
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.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 |