Skip to content

Main 🚀

Main 🚀 #423

Workflow file for this run

name: Main 🚀
on:
workflow_run:
workflows: ["bump"]
types:
- completed
jobs:
env:
uses: devxp-tech/.github/.github/workflows/env.yaml@main
lint-chart:
name: Chart Lint 🔎
runs-on: ubuntu-latest
needs:
- env
steps:
- name: Checkout Lint 🛎️
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python 🐍
uses: actions/setup-python@v5
with:
python-version: '3.10'
check-latest: true
- name: Set up chart-testing 🔎
uses: helm/[email protected]
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Run chart-testing (lint)
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --target-branch ${{ github.event.repository.default_branch }}
- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/[email protected]
- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
run: ct install --target-branch ${{ github.event.repository.default_branch }}
kubeval-chart:
name: Chart Validator 🔎
runs-on: ubuntu-latest
needs:
- env
strategy:
matrix:
k8s:
- v1.16.8
- v1.17.4
- v1.20.15
- v1.21.13
- v1.22.10
steps:
- name: Checkout Kubeval 🛎️
uses: actions/checkout@v4
- name: Run kubeval 🔎
env:
KUBERNETES_VERSION: ${{ matrix.k8s }}
run: .github/kubeval.sh
# quality-gate:
# uses: devxp-tech/.github/.github/workflows/sonarqube.yaml@main
# secrets: inherit
# needs:
# - env
release:
name: Chart Release ✨
needs:
- lint-chart
# - quality-gate
- kubeval-chart
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Git setup 🔧
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token
- name: Generate Helm Docs 📝
uses: docker://jnorwood/helm-docs:latest
with:
entrypoint: /usr/bin/helm-docs
args: --chart-search-root /github/workspace
- name: Run chart-releaser 📈
uses: helm/chart-releaser-action@main
env:
CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
CR_SKIP_EXISTING: true
- name: Commit Changes
id: docs_updater
uses: stefanzweifel/[email protected]
with:
commit_message: ":robot: Update Docs"
repository: .
artifacts:
name: Generate Artifacts 📦
runs-on: ubuntu-latest
needs:
- release
steps:
- name: Checkout Artifacts 🛎️
uses: actions/checkout@v4
with:
ref: artifacts
- name: Git setup 🔧
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token
- name: Download artifacts 📦
run: |
gh release list | awk '{print$1}' | while read line; do gh release download $line || true; done
if [[ $(git status -s) ]]; then
git add .
git commit -m ":robot: [github actions actor] update artifact list"
git push
else
echo "nothing to commit!!!"
fi
- name: Install Helm ☸️
uses: azure/setup-helm@v4
with:
version: v3.8.1
- name: Generate updated index.yaml 📦
run: |
helm repo index . --url "https://raw.githubusercontent.com/devxp-tech/helm-charts/artifacts/"
- name: Persist index.yaml 📦
uses: actions/upload-artifact@v4
with:
name: gh-pages
path: ./index.yaml
if-no-files-found: error
index:
name: Index Update 📝
runs-on: ubuntu-latest
needs:
- artifacts
steps:
- name: Chekcout 🛎️
uses: actions/checkout@v4
with:
ref: gh-pages
fetch-depth: 1
- name: Git setup 🔧
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token
- uses: actions/download-artifact@v4
with:
name: gh-pages
- name: Commit New index.yaml 📝
run: |
if [[ $(git diff) ]];
then
git add index.yaml
git commit -m "[ci skip] :robot: [github actions actor] - update index.yaml"
git push
else
echo "nothing to do!!!"
fi
# changelog:
# name: Update Changelog 📝
# runs-on: ubuntu-latest
# needs:
# - index
# steps:
# - name: Checkout 🛎️ # Required to mount the Github Workspace to a volume
# uses: actions/checkout@v4
# - name: Docker Run 🐳
# uses: addnab/docker-run-action@v3
# with:
# image: mogensen/helm-changelog:latest
# options: -v ${{ github.workspace }}:/data
# run: "/app/helm-changelog"
# - name: Commit New Changelog.md 📝
# run: |
# if [[ $(git diff) ]];
# then
# git add Changelog.md
# git commit -m "[ci skip] :robot: [github actions actor] - Add Changelog.md"
# git push
# else
# echo "nothing to do!!!"
# fi
notify:
uses: devxp-tech/.github/.github/workflows/notify.yaml@main
if: always()
secrets: inherit
needs:
- index
# - changelog