fix(ci): retry with corrected container name

This commit is contained in:
Keyvan Ebrahimpour 2025-04-11 20:15:41 +00:00
parent 11806ed02c
commit 411efc023a

View file

@ -46,15 +46,11 @@ jobs:
run: |
CONTAINER=$(kubectl -n $NAMESPACE get deployment homepage -o=jsonpath='{.spec.template.spec.containers[0].name}')
echo "container=$CONTAINER" >> $GITHUB_OUTPUT
env:
NAMESPACE: ${{ github.ref == 'refs/heads/main' && 'prod' || 'web' }}
- name: Deploy to Kubernetes
run: |
IMAGE="ghcr.io/${{ github.repository }}:$VERSION"
CONTAINER="${{ steps.detect-container.outputs.container }}"
echo "Deploying $CONTAINER with image $IMAGE to $NAMESPACE"
kubectl set image deployment/homepage $CONTAINER=$IMAGE -n $NAMESPACE
kubectl set image deployment/homepage ${{ steps.detect-container.outputs.container }}=$IMAGE -n $NAMESPACE
env:
VERSION: ${{ vars.VERSION || 'latest' }}
NAMESPACE: ${{ github.ref == 'refs/heads/main' && 'prod' || 'web' }}