Fix k8s deployment error
This commit is contained in:
parent
7e3665b2cf
commit
93629b61f9
1 changed files with 2 additions and 2 deletions
4
.github/workflows/build-and-deploy.yaml
vendored
4
.github/workflows/build-and-deploy.yaml
vendored
|
|
@ -48,7 +48,7 @@ jobs:
|
||||||
- name: Detect container name
|
- name: Detect container name
|
||||||
id: detect-container
|
id: detect-container
|
||||||
run: |
|
run: |
|
||||||
CONTAINER=$(kubectl -n $NAMESPACE get deployment homepage -o=jsonpath='{.spec.template.spec.containers[0].name}')
|
CONTAINER=$(kubectl -n $NAMESPACE get deployment landing-page -o=jsonpath='{.spec.template.spec.containers[0].name}')
|
||||||
echo "container=$CONTAINER" >> $GITHUB_OUTPUT
|
echo "container=$CONTAINER" >> $GITHUB_OUTPUT
|
||||||
env:
|
env:
|
||||||
NAMESPACE: ${{ github.ref == 'refs/heads/main' && 'prod' || 'web' }}
|
NAMESPACE: ${{ github.ref == 'refs/heads/main' && 'prod' || 'web' }}
|
||||||
|
|
@ -58,7 +58,7 @@ jobs:
|
||||||
IMAGE="ghcr.io/${{ github.repository }}:$VERSION"
|
IMAGE="ghcr.io/${{ github.repository }}:$VERSION"
|
||||||
CONTAINER="${{ steps.detect-container.outputs.container }}"
|
CONTAINER="${{ steps.detect-container.outputs.container }}"
|
||||||
echo "Setting image for container $CONTAINER"
|
echo "Setting image for container $CONTAINER"
|
||||||
kubectl set image deployment/homepage $CONTAINER=$IMAGE -n $NAMESPACE
|
kubectl set image deployment/landing-page $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