fix: fixes broken deployment

This commit is contained in:
2025-11-07 18:15:09 -03:00
parent 1f1aba38bc
commit d7aef57e7a
2 changed files with 11 additions and 9 deletions

View File

@@ -11,11 +11,8 @@ on:
jobs: jobs:
deploy: deploy:
name: Deploy to Cluster name: Deploy to Cluster
environment: ${{ github.ref_name == 'main' && 'prod' || 'staging' }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 30 timeout-minutes: 30
env:
NAMESPACE: ${{ vars.NAMESPACE }}
steps: steps:
- name: Checkout Repository - name: Checkout Repository

View File

@@ -27,13 +27,18 @@ kubectl create namespace cert-manager \
kubectl apply -f manifest/charts/cert-manager kubectl apply -f manifest/charts/cert-manager
### configures docker registry secret ### ### set application namespaces and configures docker registry secret ###
if [[ -f $HOME/.docker/config.json ]]; then if [[ -f $HOME/.docker/config.json ]]; then
kubectl create secret generic regcred \ for NAMESPACE in ${NAMESPACES_LIST//,/ }; do
--from-file=.dockerconfigjson=$HOME/.docker/config.json \ kubectl create namespace $NAMESPACE \
--type=kubernetes.io/dockerconfigjson \ --dry-run=client -o yaml | kubectl apply -f -
--namespace=$NAMESPACE \
--dry-run=client -o yaml | kubectl apply -f - kubectl create secret generic $(echo $NAMESPACE | tr '[:upper:]' '[:lower:]')-regcred \
--from-file=.dockerconfigjson=$HOME/.docker/config.json \
--type=kubernetes.io/dockerconfigjson \
-n $NAMESPACE \
--dry-run=client -o yaml | kubectl apply -f -
done
else else
echo "Docker config file not found at $HOME/.docker/config.json. Skipping registry secret creation." echo "Docker config file not found at $HOME/.docker/config.json. Skipping registry secret creation."
fi fi