fix(ci): retry with corrected container name
This commit is contained in:
parent
11806ed02c
commit
411efc023a
1 changed files with 1 additions and 5 deletions
6
.github/workflows/build-and-deploy.yaml
vendored
6
.github/workflows/build-and-deploy.yaml
vendored
|
|
@ -46,15 +46,11 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
CONTAINER=$(kubectl -n $NAMESPACE get deployment homepage -o=jsonpath='{.spec.template.spec.containers[0].name}')
|
CONTAINER=$(kubectl -n $NAMESPACE get deployment homepage -o=jsonpath='{.spec.template.spec.containers[0].name}')
|
||||||
echo "container=$CONTAINER" >> $GITHUB_OUTPUT
|
echo "container=$CONTAINER" >> $GITHUB_OUTPUT
|
||||||
env:
|
|
||||||
NAMESPACE: ${{ github.ref == 'refs/heads/main' && 'prod' || 'web' }}
|
|
||||||
|
|
||||||
- name: Deploy to Kubernetes
|
- name: Deploy to Kubernetes
|
||||||
run: |
|
run: |
|
||||||
IMAGE="ghcr.io/${{ github.repository }}:$VERSION"
|
IMAGE="ghcr.io/${{ github.repository }}:$VERSION"
|
||||||
CONTAINER="${{ steps.detect-container.outputs.container }}"
|
kubectl set image deployment/homepage ${{ steps.detect-container.outputs.container }}=$IMAGE -n $NAMESPACE
|
||||||
echo "Deploying $CONTAINER with image $IMAGE to $NAMESPACE"
|
|
||||||
kubectl set image deployment/homepage $CONTAINER=$IMAGE -n $NAMESPACE
|
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ vars.VERSION || 'latest' }}
|
VERSION: ${{ vars.VERSION || 'latest' }}
|
||||||
NAMESPACE: ${{ github.ref == 'refs/heads/main' && 'prod' || 'web' }}
|
NAMESPACE: ${{ github.ref == 'refs/heads/main' && 'prod' || 'web' }}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue