Skip to content

πŸ”€ :: μ•ˆ μ“°λŠ” 파일 μ‚­μ œ #47

πŸ”€ :: μ•ˆ μ“°λŠ” 파일 μ‚­μ œ

πŸ”€ :: μ•ˆ μ“°λŠ” 파일 μ‚­μ œ #47

Workflow file for this run

## Reference: https://github.com/helm/chart-releaser-action
name: Chart Publish
on:
push:
branches:
- main
paths:
- "helm/**"
permissions:
contents: read
jobs:
publish:
permissions:
contents: write
packages: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Install Helm
uses: azure/[email protected]
with:
version: v3.10.1 # Also update in lint-and-test.yaml
- name: Add helm repo
working-directory: helm
run: |
find . -mindepth 1 -maxdepth 1 -type d |
while IFS= read -r package_directory; do
helm dependency update $(basename "$package_directory")
done
find . -mindepth 2 -maxdepth 2 -name "Chart.lock" |
while IFS= read -r chart_lock_file; do
yq eval '.dependencies[] | .repository' "$chart_lock_file" |
while IFS= read -r repo; do
if [ -n "$repo" ]; then
random_name=$(LC_ALL=C tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 12 | head -n 1)
helm repo add $random_name $repo || true
fi
done
done
- name: Helm build
working-directory: helm
run: |
find . -mindepth 1 -maxdepth 1 -type d |
while IFS= read -r package_directory; do
dir_name=$(basename "$package_directory")
helm dependency build $dir_name
helm package $dir_name
done
- name: Get Helm package
id: helm_package
run: |
package_list=$(find . -type f -mindepth 1 -maxdepth 1 -name "*.tgz" -exec basename {} \; | tr '\n' ' ')
echo $package_list
echo "package_list=$package_list" >> $GITHUB_OUTPUT
- name: Checkout gh-pages branch
uses: actions/checkout@v2
with:
ref: gh-pages
- name: Get *.tgz files
run: |
git checkout main -- ${{ steps.helm_package.outputs.package_list }}
- name: Commit The Chart Realease
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: ${{ github.event.head_commit.message }}
branch: gh-pages
commit_options: '--no-verify --signoff'
repository: .
commit_user_name: XQUARE GitOps Bot
commit_user_email: [email protected]
commit_author: XQUARE GitOps Bot <[email protected]>