Aggiungi il debug per la lista dei file e correggi il percorso nel file di deployment
Some checks failed
GKE Auto-Deploy / build-and-deploy (push) Failing after 30s

This commit is contained in:
2026-01-28 18:27:08 +01:00
parent e4fff4da9e
commit b6eb2d9636
2 changed files with 6 additions and 4 deletions

View File

@@ -48,6 +48,8 @@ jobs:
# --- PARTE NUOVA: TEMPLATING E APPLY --- # --- PARTE NUOVA: TEMPLATING E APPLY ---
- name: Deploy to GKE - name: Deploy to GKE
run: | run: |
echo "Ecco i file presenti nella cartella:"
ls -R
gcloud container clusters get-credentials ${{ env.CLUSTER_NAME }} --zone ${{ env.CLUSTER_ZONE }} gcloud container clusters get-credentials ${{ env.CLUSTER_NAME }} --zone ${{ env.CLUSTER_ZONE }}
# 1. Installiamo envsubst (se non c'è già nell'immagine, di solito c'è ma per sicurezza) # 1. Installiamo envsubst (se non c'è già nell'immagine, di solito c'è ma per sicurezza)
@@ -56,7 +58,7 @@ jobs:
# 2. Sostituzione variabili # 2. Sostituzione variabili
# Legge k8s/deployment.yaml, sostituisce ${APP_NAME} e ${FULL_IMAGE_NAME} # Legge k8s/deployment.yaml, sostituisce ${APP_NAME} e ${FULL_IMAGE_NAME}
# Scrive il risultato in un file temporaneo 'final-deploy.yaml' # Scrive il risultato in un file temporaneo 'final-deploy.yaml'
envsubst < ./k8s/deployment.yaml > final-deploy.yaml envsubst < k8s/deployment.yaml > final-deploy.yaml
# (Opzionale) Stampiamo il file per debug # (Opzionale) Stampiamo il file per debug
echo "--- FILE YAML GENERATO ---" echo "--- FILE YAML GENERATO ---"

View File

@@ -1,7 +1,7 @@
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: ${APP_NAME} name: ${APP_NAME}
labels: labels:
app: ${APP_NAME} app: ${APP_NAME}
spec: spec:
@@ -16,14 +16,14 @@ spec:
spec: spec:
containers: containers:
- name: app-container - name: app-container
image: ${FULL_IMAGE_NAME} image: ${FULL_IMAGE_NAME}
ports: ports:
- containerPort: 80 - containerPort: 80
--- ---
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: ${APP_NAME}-service name: ${APP_NAME}-service
spec: spec:
type: LoadBalancer type: LoadBalancer
selector: selector: