Skip to content

Commit

Permalink
⚡ (ci): Improve Chart Releaser CI speed
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Aug 2, 2023
1 parent b3408b6 commit d09d681
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,45 @@ jobs:
sed -i '/^<img .* alt=".* logo"/,+1d' "$f"
done
- name: Run chart-releaser
- name: Install chart-releaser
uses: helm/[email protected]
with:
install_only: true

- name: Package charts
id: package_charts
run: |
changed_charts=""
for dir in charts/*; do
chart_name="$(basename "$dir")"
version="$(yq '.version' "$dir/Chart.yaml")"
if ! git rev-parse "$chart_name-${version#v}" &>/dev/null; then
cr package --package-path=.cr-release-packages "$dir"
changed_charts+="$chart_name,"
fi
done
echo "changed_charts=${changed_charts%,}" >> $GITHUB_OUTPUT
- name: Publish charts
uses: helm/[email protected]
if: steps.package_charts.outputs.changed_charts != ''
with:
skip_packaging: true
env:
CR_TOKEN: "${{ github.token }}"
CR_TOKEN: ${{ github.token }}
CR_SKIP_EXISTING: "true"
CR_PAGES_BRANCH: helm-index

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
if: steps.package_charts.outputs.changed_charts != ''
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- name: Push charts to GHCR
if: steps.package_charts.outputs.changed_charts != ''
run: |
for pkg in .cr-release-packages/*; do
if [ -z "${pkg:-}" ]; then
Expand Down

0 comments on commit d09d681

Please sign in to comment.