Skip to content

Fix bug in GH Actions for "Chart Install" #97

Fix bug in GH Actions for "Chart Install"

Fix bug in GH Actions for "Chart Install" #97

Workflow file for this run

name: Lint, Test and Deploy Charts
on:
push:
paths:
- charts/**
- .github/workflows/**
pull_request:
paths:
- charts/**
- .github/workflows/**
jobs:
lint-charts:
name: Lint Charts
runs-on: ubuntu-22.04
steps:
- name: "Checkout"
uses: actions/checkout@v2.4.2
with:
fetch-depth: 0
- name: "Set Up Helm"
uses: azure/setup-helm@v3.3
if: github.ref != 'refs/heads/main'
with:
version: v3.4.1
- name: "Set Up Python"
uses: actions/setup-python@v4.2.0
if: github.ref != 'refs/heads/main'
with:
python-version: 3.9
- name: "Set up chart-testing"
uses: helm/chart-testing-action@v2.3.0
if: github.ref != 'refs/heads/main'
with:
version: v3.3.0
- name: "Run chart-testing (list-changed)"
id: list-changed
if: github.ref != 'refs/heads/main'
run: |
changed=$(ct list-changed --config .github/ct/ct.yaml)
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
echo "changed-list=$changed" >> $GITHUB_OUTPUT
fi
- name: "Save Testing Values from Secret"
shell: bash
env:
SECRET_VALUES: ${{ secrets.FOUNDRY_SECRET_VALUES }}
run: echo "$SECRET_VALUES" | base64 -d > ./charts/foundry-vtt/ci/test-values.yaml
if: github.ref != 'refs/heads/main' && contains(steps.list-changed.outputs.changed-list, 'charts/foundry-vtt')
- name: "Run chart-testing (lint)"
run: ct lint --config .github/ct/ct.yaml --lint-conf .github/ct/lintconf.yaml --chart-yaml-schema .github/ct/chart_schema.yaml
if: steps.list-changed.outputs.changed == 'true' && github.ref != 'refs/heads/main'
install-charts:
name: Install Charts
runs-on: ubuntu-22.04
steps:
- name: "Checkout"
uses: actions/checkout@v2.4.2
with:
fetch-depth: 0
- name: "Set Up Helm"
uses: azure/setup-helm@v3.3
if: github.ref != 'refs/heads/main'
with:
version: v3.4.1
- name: "Set Up Python"
uses: actions/setup-python@v4.2.0
if: github.ref != 'refs/heads/main'
with:
python-version: 3.9
- name: "Set up chart-testing"
uses: helm/chart-testing-action@v2.3.0
if: github.ref != 'refs/heads/main'
with:
version: v3.3.0
- name: "Run chart-testing (list-changed)"
id: list-changed
if: github.ref != 'refs/heads/main'
run: |
changed=$(ct list-changed --config .github/ct/ct.yaml)
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
echo "changed-list=$changed" >> $GITHUB_OUTPUT
fi
- name: "Save Testing Values from Secret"
shell: bash
env:
SECRET_VALUES: ${{ secrets.FOUNDRY_SECRET_VALUES }}
run: echo "$SECRET_VALUES" | base64 -d > ./charts/foundry-vtt/ci/test-values.yaml
if: github.ref != 'refs/heads/main' && contains(steps.list-changed.outputs.changed-list, 'charts/foundry-vtt')
- name: Create kind cluster
uses: helm/kind-action@v1.4.0
if: steps.list-changed.outputs.changed == 'true' && github.ref != 'refs/heads/main'
- name: Run chart-testing (install)
run: ct install --config .github/ct/ct.yaml --debug
if: steps.list-changed.outputs.changed == 'true' && github.ref != 'refs/heads/main'
release-on-github-pages:
name: Release Chart on GitHub Pages
runs-on: ubuntu-22.04
needs:
- lint-charts
- install-charts
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodule: recursive
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.1.0
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 'latest'
- name: Build Hugo
run: |
git submodule init
git submodule update
cd hugo
hugo --minify
cp -r ./public ../public
cd ..
- name: Deploy Hugo
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
cname: helm.mahahe.it
keep_files: true