diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 90416c70..d4014671 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -26,41 +26,40 @@ jobs: uses: azure/setup-helm@v3.5 with: version: v3.10.1 # Also update in lint-and-test.yaml - - - name: Filter for helm directory and store in variable - id: helm_files - run: | - helm_paths=() - for path in ${{ steps.list_files.outputs.stdout }}; do - if [[ $path == helm/* ]]; then - helm_paths+=("$path") - fi - done - echo "helm_paths=${helm_paths[*]}" >> $GITHUB_OUTPUT - name: Helm package + id: helm_package run: | - paths="${{ steps.helm_files.outputs.helm_paths }}" - for path in $paths; do - helm package "$path" + find helm -mindepth 1 -maxdepth 1 -type d | + while IFS= read -r package_directory; do + package_name=$(basename "$package_directory") + cd helm/$package_name + helm dependency update . + helm dependency build . + cd ../../ done + + helm package $(find helm -type d -mindepth 1 -maxdepth 1 -exec basename {} \; | tr '\n' ' ') + + package_list=$(find . -type f -mindepth 1 -maxdepth 1 -name "*.tgz" -exec basename {} \; | tr '\n' ' ') + echo "package_list=$package_list" >> $GITHUB_OUTPUT - - name: get and add *.tgz files - id: package_list - run: | - package_list=$(find . -type f -name "*.tgz" -exec basename {} \; | tr '\n' ' ') + - name: Checkout gh-pages branch + uses: actions/checkout@v2 + with: + ref: gh-pages - git checkout gh-pages - git checkout main -- $package_list - git add . + - name: Get *.tgz files + run: | + git checkout main -- ${{ steps.helm_package.outputs.package_list }} - - name: Commit The New Image Reference + - name: Commit The Chart Realease uses: stefanzweifel/git-auto-commit-action@v4 with: commit_message: "update :: new realease" - branch: master + branch: gh-pages commit_options: '--no-verify --signoff' repository: . commit_user_name: XQUARE GitOps Bot commit_user_email: teamxquare@gmail.com - commit_author: XQUARE GitOps Bot + commit_author: XQUARE GitOps Bot \ No newline at end of file