Skip to content

v3.0.0-alpha.3

v3.0.0-alpha.3 #17

Workflow file for this run

name: CI Release Helm Chart
on:
release:
types: [published]
env:
REPO_NAME: magda-minion-broken-link
jobs:
release-helm-chart:
name: Release Helm Chart
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 18
uses: actions/setup-node@v1
with:
node-version: 18
- name: Login to GitHub Container Registry
run: |
REPO_OWNER=`echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]'`
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- run: yarn install
- run: yarn build
- run: yarn test
- run: yarn update-all-charts
- run: yarn helm-lint
- name: Check Helm Chart Document
run: |
code=0
docker run --rm -v "$(pwd):/helm-docs" -u $(id -u) jnorwood/helm-docs:v1.13.1 -t ./README.md.gotmpl -o ../../README.md || code=$?;
if [ "$code" != "0" ]; then
echo "Failed to run helm-docs!";
exit 1;
fi;
cd deploy
code=0
git ls-files -m | grep -i readme.md || code=$?;
if [ "$code" == "0" ]; then
echo -e "Some of helm chart docs are required to be updated using the [helm-docs](https://github.com/norwoodj/helm-docs) tool. \n
Please run helm-docs (v1.13.1) at project root, review & commit docs changes and push a new commit.";
exit 1;
else
echo -e "helm docs check passed. helm docs update is not required.";
fi;
- name: helm-chart-version-check
run: yarn check-helm-chart-version deploy/${REPO_NAME}/Chart.yaml
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build Docker Image & Push
run: |
REPO_OWNER=`echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]'`
yarn docker-build-prod --repository=ghcr.io/${REPO_OWNER} --name=${REPO_NAME} --version=${GITHUB_SHA} --platform=linux/amd64,linux/arm64
- name: Re-tag & Push Docker Images
run: |
REPO_OWNER=`echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]'`
PACKAGE_JSON_VERSION=$(jq -r ".version" ./package.json)
chmod +r $HOME/.docker/config.json
# Re-push to ghcr.io
docker container run --rm --net host \
-v regctl-conf:/home/appuser/.regctl/ \
-v $HOME/.docker/config.json:/home/appuser/.docker/config.json \
regclient/regctl:v0.3.9 image copy ghcr.io/${REPO_OWNER}/${REPO_NAME}:${GITHUB_SHA} ghcr.io/${REPO_OWNER}/${REPO_NAME}:${PACKAGE_JSON_VERSION}
- name: Release Helm Chart
run: |
REPO_OWNER=`echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]'`
cd deploy
helm package ${REPO_NAME}
PKG_NAME=`ls *.tgz`
helm push ${PKG_NAME} oci://ghcr.io/${REPO_OWNER}/charts