mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 08:57:04 +02:00
ci: Rework publishing CI (#381)
This commit is contained in:
parent
b8c2eca310
commit
c94a28baa3
10 changed files with 512 additions and 274 deletions
70
.github/actions/charts-release-ghpages/action.yaml
vendored
Normal file
70
.github/actions/charts-release-ghpages/action.yaml
vendored
Normal file
|
@ -0,0 +1,70 @@
|
|||
---
|
||||
name: "Prepare chart artifacts for release"
|
||||
description: "Prepare chart artifacts for release to GitHub Pages"
|
||||
inputs:
|
||||
artifactPattern:
|
||||
description: "Pattern to match artifacts to release"
|
||||
required: true
|
||||
artifactPrefix:
|
||||
description: "Prefix to strip from the artifact names"
|
||||
required: false
|
||||
default: ""
|
||||
targetFolder:
|
||||
description: "Folder where to move the chart artifacts"
|
||||
required: true
|
||||
default: gh-pages
|
||||
targetBranch:
|
||||
description: "Branch to push the chart artifacts"
|
||||
required: true
|
||||
default: gh-pages
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Prepare artifacts folder
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p artifacts
|
||||
|
||||
- name: Download chart artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: artifacts
|
||||
pattern: ${{ inputs.artifactPrefix }}${{ inputs.artifactPattern }}
|
||||
|
||||
- name: Copy artifacts to gh-pages structure
|
||||
shell: bash
|
||||
working-directory: artifacts
|
||||
env:
|
||||
ARTIFACT_PREFIX: ${{ inputs.artifactPrefix }}
|
||||
TARGET_FOLDER: ${{ inputs.targetFolder }}
|
||||
run: |
|
||||
while IFS= read -d $'\0' -r ARTIFACT ; do
|
||||
echo ${ARTIFACT}
|
||||
prefix_removed_chart=${ARTIFACT/#$ARTIFACT_PREFIX}
|
||||
DELIMITER='__'
|
||||
s=${prefix_removed_chart}${DELIMITER}
|
||||
ARTIFACT_PATH_PARTS=();
|
||||
while [[ $s ]]; do
|
||||
ARTIFACT_PATH_PARTS+=( "${s%%"${DELIMITER}"*}" );
|
||||
s=${s#*"${DELIMITER}"};
|
||||
done;
|
||||
|
||||
CHART_FOLDER=${ARTIFACT_PATH_PARTS[0]}
|
||||
mkdir -p "${TARGET_FOLDER}/${CHART_FOLDER}"
|
||||
cp ${ARTIFACT}/* ${TARGET_FOLDER}/${CHART_FOLDER}/
|
||||
done < <(find . -mindepth 1 -maxdepth 1 -type d -print0)
|
||||
|
||||
- name: Update chart index
|
||||
shell: bash
|
||||
working-directory: ${{ inputs.targetFolder }}
|
||||
run: |
|
||||
helm repo index . --url https://bjw-s.github.io/helm-charts/
|
||||
|
||||
- name: Commit Changes
|
||||
uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
repository: ${{ inputs.targetFolder }}
|
||||
branch: ${{ inputs.targetBranch }}
|
||||
file_pattern: "index.yaml **/*.tgz"
|
||||
disable_globbing: true
|
Loading…
Add table
Add a link
Reference in a new issue