Skip to content

Commit 3bc4a08

Browse files
committed
fix(ci): add tags and version logic on docker and helm
1 parent 3cf38db commit 3bc4a08

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ jobs:
5050
name: docker (build and push)
5151
runs-on: ubuntu-latest
5252
needs: [go]
53-
# if: github.event_name != 'pull_request'
5453

5554
permissions:
5655
contents: read
@@ -82,10 +81,10 @@ jobs:
8281
images: ghcr.io/${{ github.repository }}
8382
tags: |
8483
type=raw,value=latest,enable={{is_default_branch}}
85-
type=sha,format=short,prefix=0.1.0-
84+
type=sha,format=short,prefix=0.1.0-c
8685
type=ref,event=tag
8786
88-
- name: Build and push
87+
- name: Build and push docker image
8988
uses: docker/build-push-action@v6
9089
with:
9190
context: .
@@ -159,13 +158,23 @@ jobs:
159158
mkdir -p dist
160159
helm package helm \
161160
--destination dist \
162-
--version "${{ steps.ver.outputs.version }}" \
163-
--app-version "${{ steps.ver.outputs.version }}"
161+
--version "${{ steps.ver.outputs.docker_image_tag }}" \
162+
--app-version "${{ steps.ver.outputs.docker_image_tag }}"
164163
165164
- name: Push chart to GHCR (OCI)
166165
shell: bash
167166
run: |
168167
set -euo pipefail
169168
OWNER_LC="$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')"
170-
CHART_TGZ="$(ls -1 dist/cacheppuccino-*.tgz | head -n 1)"
171-
helm push "${CHART_TGZ}" "oci://ghcr.io/${OWNER_LC}"
169+
OCI_REPO="oci://ghcr.io/${OWNER_LC}"
170+
PACKAGE_FILE="$(ls -1 dist/cacheppuccino-*.tgz | head -n 1)"
171+
IMAGE="${{ needs.docker.outputs.docker_image_tag }}"
172+
173+
# Add GitHub Actions summary
174+
echo "# Helm Chart" >> $GITHUB_STEP_SUMMARY
175+
echo "" >> $GITHUB_STEP_SUMMARY
176+
echo '```yaml' >> $GITHUB_STEP_SUMMARY
177+
helm push "$PACKAGE_FILE" "$OCI_REPO" 2>> $GITHUB_STEP_SUMMARY
178+
echo '```' >> $GITHUB_STEP_SUMMARY
179+
echo "> [!Important]" >> $GITHUB_STEP_SUMMARY
180+
echo "> NOTE: Tagged Docker image & Helm chart version: **$IMAGE**" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)