Skip to content
on: push
name: Check values files
jobs:
diff:
runs-on: ubuntu-latest
env:
TMP_DIR: "/tmp/shared"
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Create directories
run: |
mkdir -p ~/.local/bin
mkdir -p "${TMP_DIR}"
chmod 777 "${TMP_DIR}"
- name: Create helmfile docker shim
run: |
echo 'docker run --rm -v "/tmp:/tmp" -v "${PWD}:/workdir" --workdir /workdir \
ghcr.io/helmfile/helmfile:latest helmfile $*' \
| tee ~/.local/bin/helmfile
chmod +x ~/.local/bin/helmfile
- name: Create yq docker shim
run: |
echo 'docker run --rm -v "/tmp:/tmp" -v "${PWD}:/workdir" --workdir /workdir mikefarah/yq $*' \
| tee ~/.local/bin/yq
chmod +x ~/.local/bin/yq
- name: Diff generated value files
run: >
for ENV_DIR in k8s/argocd/*; do
ENV=$(basename "${ENV_DIR}")
for RELEASE_FILE in "${ENV_DIR}"/*.values.yaml; do
RELEASE=$(basename "${RELEASE_FILE}" .values.yaml)
TMP_VALUES="${TMP_DIR}"/tmp_"${ENV}.${RELEASE}".yml
echo "checking $RELEASE_FILE - [$ENV] [$RELEASE]"
./bin/generate-values "${ENV}" "${RELEASE}" "${TMP_VALUES}"
diff "${TMP_VALUES}" "${RELEASE_FILE}"
done
done