diff --git a/publish-container/action.yaml b/publish-container/action.yaml index e7a328a..fc601d2 100644 --- a/publish-container/action.yaml +++ b/publish-container/action.yaml @@ -120,31 +120,31 @@ runs: run: | set -euo pipefail cd manifests/charts/${{ inputs.project }} - + IMAGE_TAG="${{ steps.envvars.outputs.IMAGE_TAG }}" - + echo "=== Deploying production with image.tag=$IMAGE_TAG ===" - + if [ -z "$IMAGE_TAG" ]; then echo "::error::IMAGE_TAG is empty" exit 1 fi - + nix-shell -p yq-go --run ' set -euo pipefail yq eval ".image.tag = \"'"$IMAGE_TAG"'\"" -i values.yaml yq eval ".version = \"'"$IMAGE_TAG"'\" | .appVersion = \"'"$IMAGE_TAG"'\"" -i Chart.yaml ' - + echo "=== Git diff ===" git diff values.yaml Chart.yaml - + git add values.yaml Chart.yaml if git diff --cached --quiet; then echo "No changes to commit" exit 0 fi - + git commit -m "ci(prod): deploy ${{ inputs.project }} $IMAGE_TAG" git push origin main @@ -154,16 +154,16 @@ runs: run: | set -euo pipefail cd manifests/values/${{ inputs.project }} - + IMAGE_TAG="${{ steps.envvars.outputs.IMAGE_TAG }}" - + echo "=== Deploying staging with image.tag=$IMAGE_TAG ===" - + if [ -z "$IMAGE_TAG" ]; then echo "::error::IMAGE_TAG is empty" exit 1 fi - + # Find and update staging file if [ -f values-staging.yaml ]; then TARGET_FILE="values-staging.yaml" @@ -177,24 +177,24 @@ runs: TARGET_FILE="values/${{ inputs.project }}-staging.yaml.gotmpl" else echo "::error::No staging values file found" - exit 1 + TARGET_FILE="values/values.yaml" fi - + echo "=== Updating $TARGET_FILE ===" - + nix-shell -p yq-go --run ' set -euo pipefail yq eval ".image.tag = \"'"$IMAGE_TAG"'\"" -i "'"$TARGET_FILE"'" ' - + echo "=== Git diff ===" git diff "$TARGET_FILE" - + git add "$TARGET_FILE" if git diff --cached --quiet; then echo "No changes to commit" exit 0 fi - + git commit -m "ci(staging): deploy ${{ inputs.project }} $IMAGE_TAG" git push origin main