feat(yace): allow overriding image registry (#52) #24
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
name: Release helm chart | |
on: | |
push: | |
branches: [main] | |
paths: | |
- "charts/yet-another-cloudwatch-exporter/Chart.yaml" | |
jobs: | |
release: | |
if: github.repository == 'nerdswords/helm-charts' | |
permissions: | |
contents: write | |
packages: write # needed for ghcr access | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Configure Git | |
run: | | |
git config user.name "$GITHUB_ACTOR" | |
git config user.email "[email protected]" | |
- name: Install Helm | |
uses: azure/setup-helm@v4 | |
with: | |
version: v3.9.0 | |
- name: Run chart-releaser | |
uses: helm/[email protected] | |
env: | |
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
CR_RELEASE_NAME_TEMPLATE: "yace-helm-chart-{{ .Version }}" | |
# see https://github.com/helm/chart-releaser/issues/183 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push charts to GHCR | |
run: | | |
shopt -s nullglob | |
for pkg in .cr-release-packages/*; do | |
if [ -z "${pkg:-}" ]; then | |
break | |
fi | |
helm push "${pkg}" "oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/charts" | |
done | |
sync-readme: | |
needs: [release] | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Copy README | |
run: | | |
cp -f README.md ${{ runner.temp }}/root-README.md | |
cp -f charts/yet-another-cloudwatch-exporter/README.md ${{ runner.temp }}/chart-README.md | |
- name: Checkout branch gh-pages | |
uses: actions/checkout@v4 | |
with: | |
ref: gh-pages | |
- name: Configure Git | |
run: | | |
git config user.name "$GITHUB_ACTOR" | |
git config user.email "[email protected]" | |
- name: Commit and push | |
run: | | |
cp -f ${{ runner.temp }}/root-README.md README.md | |
git add README.md | |
cp -f ${{ runner.temp }}/chart-README.md charts/yet-another-cloudwatch-exporter/README.md | |
git add charts/yet-another-cloudwatch-exporter/README.md | |
git commit -m "Sync README from main" | |
git push |