Merge pull request #97 from FusionAuth/git-safe-dir #23
Workflow file for this run
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
on: | |
push: | |
tags: | |
- '**' | |
jobs: | |
release: | |
runs-on: ubuntu-22.04 | |
container: | |
image: quay.io/helmpack/chart-releaser:v1.6.1 | |
outputs: | |
version: ${{ steps.release.outputs.version }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Update version in Chart.yaml | |
run: | | |
sed -i "s|version: 0.0.0+dev|version: ${GITHUB_REF##*/}|" chart/Chart.yaml | |
- name: configure git | |
run: | | |
git config --global user.name "$GITHUB_ACTOR" | |
git config --global user.email "[email protected]" | |
git config --global --add safe.directory /__w/charts/charts | |
- name: Release | |
env: | |
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
CR_OWNER: fusionauth | |
CR_GIT_REPO: charts | |
CR_PACKAGE_PATH: .deploy | |
CR_INDEX_PATH: index.yaml | |
CR_PAGES_BRANCH: main | |
CR_RELEASE_NAME_TEMPLATE: "{{ .Version }}" | |
run: | | |
cr package chart | |
cr upload | |
cr index --push | |
ARCHIVE=$(ls ${CR_PACKAGE_PATH}) | |
echo "::set-output name=version::${ARCHIVE%.*}" | |
install: | |
runs-on: ubuntu-22.04 | |
needs: release | |
steps: | |
- name: Set up helm | |
uses: azure/setup-helm@v3 | |
- name: Set up kind | |
uses: helm/[email protected] | |
- name: Install the chart in kind | |
env: | |
CHARTS_REPO: https://fusionauth.github.io/charts | |
run: | | |
helm repo add fusionauth ${CHARTS_REPO} | |
helm install fusionauth fusionauth/fusionauth \ | |
--set database.host=host \ | |
--set database.user=user \ | |
--set database.password=password \ | |
--set search.host=host | |
- name: Verify the chart version | |
env: | |
RELEASED_VERSION: ${{ needs.release.outputs.version }} | |
run: | | |
INSTALLED_VERSION=$(helm list -m1 -f 'fusionauth*' -o json | jq -r '.[0].chart' ) | |
if [[ "${RELEASED_VERSION}" != "${INSTALLED_VERSION}" ]]; then | |
echo "Incorrect Version Installed ..." | |
echo "Released Version: $RELEASED_VERSION" | |
echo "Installed Version: $INSTALLED_VERSION" | |
exit 1 | |
else | |
echo "Installed $INSTALLED_VERSION as expected." | |
fi |