Skip to content

Merge pull request #742 from cybozu-go/bump-chart-v0.24.1 #25

Merge pull request #742 from cybozu-go/bump-chart-v0.24.1

Merge pull request #742 from cybozu-go/bump-chart-v0.24.1 #25

Workflow file for this run

name: Release Charts
on:
push:
tags:
- 'chart-v*'
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.10.2
- name: Check chart version
run: |
tag_version=${GITHUB_REF##*/chart-v}
chart_version=$(cat charts/moco/Chart.yaml | grep 'version:' | sed 's/version:\s//')
if [ "$tag_version" != "$chart_version" ]; then
echo "Different versions: tag \"$tag_version\", chart \"$chart_version\""
exit 1
fi
- name: Packaging the chart
run: helm package ./charts/moco/
- uses: actions/upload-artifact@v4
with:
name: helm-charts
path: ./moco-*.tgz
retention-days: 1
publish:
name: Publish charts on GitHub Pages
runs-on: ubuntu-22.04
needs: build
steps:
- uses: actions/checkout@v4
with:
ref: gh-pages
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.15.0
- uses: actions/download-artifact@v4
with:
name: helm-charts
- name: Update charts index
run: helm repo index --url https://cybozu-go.github.io/moco/ --merge index.yaml .
- run: git add .
- name: Check diffs
run: |
diffs=$(git status -s)
if [ "$diffs" = "" ]; then
echo "NO_DIFF=1" >> $GITHUB_ENV
else
printf "%s\n" "$diffs"
fi
- name: Commit changes
if: env.NO_DIFF != '1'
run: |
git config --global user.name 'Cybozu Neco'
git config --global user.email 'cybozu-neco@users.noreply.github.com'
git commit -m 'update'
- name: Push to gh-pages
if: env.NO_DIFF != '1'
run: git push origin gh-pages