diff --git a/.github/workflows/kubenetmon.yaml b/.github/workflows/kubenetmon.yaml index 09c4686..0a9d8af 100644 --- a/.github/workflows/kubenetmon.yaml +++ b/.github/workflows/kubenetmon.yaml @@ -72,7 +72,9 @@ jobs: load: true - name: Save image as artifact - run: docker save -o image.tar $(echo "${{ steps.meta.outputs.tags }}" | cut -d',' -f1) + run: | + first_tag=$(echo "${{ steps.meta.outputs.tags }}" | head -n 1) + docker save -o image.tar $first_tag - name: Upload image artifact uses: actions/upload-artifact@v4 @@ -119,7 +121,7 @@ jobs: - name: Create required resources for test run: | - first_tag=$(echo "${{ needs.build-docker-image.outputs.image-tags }}" | cut -d',' -f1) + first_tag=$(echo "${{ needs.build-docker-image.outputs.image-tags }}" | head -n 1) kind load docker-image --name chart-testing $first_tag kubectl create namespace kubenetmon-agent kubectl create namespace kubenetmon-server @@ -127,7 +129,7 @@ jobs: - name: Run chart-testing (install) run: | cd deploy/helm - first_tag=$(echo "${{ needs.build-docker-image.outputs.image-tags }}" | cut -d',' -f1) + first_tag=$(echo "${{ needs.build-docker-image.outputs.image-tags }}" | head -n 1) repository=$(echo $first_tag | cut -d':' -f1) tag=$(echo $first_tag | cut -d':' -f2) @@ -188,7 +190,18 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Push to GitHub Container Registry - run: docker push ${{ needs.build-docker-image.outputs.image-tags }} + run: | + tags=(${{ needs.build-docker-image.outputs.image-tags }}) + first_tag="${tags[0]}" + + if [ ${#tags[@]} -gt 1 ]; then + for tag in "${tags[@]:1}"; do + docker tag "$first_tag" "$tag" + docker push "$tag" + done + fi + + docker push "$first_tag" helm-publish: name: Package and publish Helm charts