Skip to content

clone repo with PAT #43

clone repo with PAT

clone repo with PAT #43

Workflow file for this run

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:
token: "${{ secrets.PAT_ACTIONS_WORKFLOWS }}"
fetch-depth: 0
- name: update placeholder versions
working-directory: ./chart
run: |
apk add -q curl jq envsubst
export APP_VERSION=$(curl -s https://account.fusionauth.io/api/version | jq -r '.versions[]' | sort -V | tail -n 1)
export CHART_VERSION="${GITHUB_REF##*/}"
echo "Chart: $CHART_VERSION"
echo "App: $APP_VERSION"
for file in Chart.yaml values.yaml README.md examples/minikube/values.yaml
do
tmpfile=$(mktemp)
cat "$file" > "$tmpfile"
envsubst < "$tmpfile" > "$file"
done
echo "APP_VERSION=$APP_VERSION" >> $GITHUB_ENV
- 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
id: release
env:
CR_TOKEN: "${{ secrets.PAT_ACTIONS_WORKFLOWS }}"
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 "version=${ARCHIVE%.*}" >> "$GITHUB_OUTPUT"
install:
runs-on: ubuntu-22.04
needs: release
steps:
- name: Set up helm
uses: azure/setup-helm@v4
- name: Set up kind
uses: helm/kind-action@v1
- 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