Longhorn #31
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build descriptors using Helm charts | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
ifIsAutoCommit: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: ${{github.event.after}} | |
- name: Check if last commit was auto generated | |
id: check | |
run: | | |
if [[ $(git log --format=%B -n 1 ${{github.event.after}}) == "Auto commit" ]]; then | |
echo "status=1" >> "$GITHUB_OUTPUT" | |
else | |
echo "status=0" >> "$GITHUB_OUTPUT" | |
fi | |
outputs: | |
status: ${{ steps.check.outputs.status }} | |
build: | |
runs-on: ubuntu-latest | |
needs: ifIsAutoCommit | |
if: needs.ifIsAutoCommit.outputs.status == '0' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.PAT }} | |
- name: Install Helm | |
uses: azure/setup-helm@v4.2.0 | |
with: | |
version: '3.17.0' | |
- name: Build descriptors | |
run: | | |
for file in $(find .charts -mindepth 2 -maxdepth 2 -type d) | |
do | |
appName="$(basename $file)" | |
distPath="$(echo $file | sed "s|\.charts\/\(.*\)\/[A-Za-z\-]*$|\1|")" | |
helm template $(basename $file) $file --output-dir $distPath | |
mv $distPath/$appName/templates/* $distPath/$appName | |
done | |
- name: Commit changes | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
file_pattern: '0-bootstrap/* 1-infrastructure/* 2-services/* 3-applications/*' | |
commit_message: "Auto commit" |