This commit is contained in:
@@ -6,7 +6,6 @@ on:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
# Solo tenemos un job que lo hace todo, remotamente.
|
||||
remote-build-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -15,7 +14,7 @@ jobs:
|
||||
run: |
|
||||
set -e # Fallar inmediatamente si algo sale mal
|
||||
|
||||
# 1. Preparar el cliente SSH dentro del contenedor del job (esto es lo único que hacemos aquí)
|
||||
# 1. Preparar el cliente SSH (lo único que hacemos en este contenedor)
|
||||
echo "Preparing SSH client..."
|
||||
apt-get update && apt-get install -y openssh-client git
|
||||
mkdir -p ~/.ssh
|
||||
@@ -30,9 +29,15 @@ jobs:
|
||||
|
||||
# --- PARTE 1: PREPARACIÓN (EN EL HOST) ---
|
||||
echo "--- (HOST) Preparing temporary workspace ---"
|
||||
REPO_URL="${{ gitea.remotes.origin.url }}"
|
||||
COMMIT_SHA="${{ gitea.sha }}"
|
||||
TEMP_DIR="/tmp/gitea-build/${{ gitea.run_id }}"
|
||||
# Usamos variables de shell estándar. El runner las pasa.
|
||||
REPO_URL="${GITEA_REMOTE_URL}"
|
||||
COMMIT_SHA="${GITEA_SHA}"
|
||||
ACTOR="${GITEA_ACTOR}"
|
||||
REPO_NAME_RAW="${GITEA_REPOSITORY}" # ej: dmolinari/GestionIntegralWeb
|
||||
# Convertimos a minúsculas usando shell, no una función del runner
|
||||
REPO_NAME=$(echo "$REPO_NAME_RAW" | tr '[:upper:]' '[:lower:]')
|
||||
|
||||
TEMP_DIR="/tmp/gitea-build/${GITEA_RUN_ID}"
|
||||
|
||||
rm -rf $TEMP_DIR
|
||||
mkdir -p $TEMP_DIR
|
||||
@@ -48,7 +53,7 @@ jobs:
|
||||
--context=/workspace \
|
||||
--dockerfile=/workspace/Backend/GestionIntegral.Api/Dockerfile \
|
||||
--no-push \
|
||||
--destination=${{ gitea.actor }}/${{ toLower(gitea.repository_name) }}-backend:latest \
|
||||
--destination=${REPO_NAME}-backend:latest \
|
||||
--tarPath=/workspace/backend.tar
|
||||
|
||||
# Frontend
|
||||
@@ -56,7 +61,7 @@ jobs:
|
||||
--context=/workspace \
|
||||
--dockerfile=/workspace/Frontend/Dockerfile \
|
||||
--no-push \
|
||||
--destination=${{ gitea.actor }}/${{ toLower(gitea.repository_name) }}-frontend:latest \
|
||||
--destination=${REPO_NAME}-frontend:latest \
|
||||
--tarPath=/workspace/frontend.tar
|
||||
|
||||
# --- PARTE 3: DESPLEGAR (EN EL HOST) ---
|
||||
|
||||
Reference in New Issue
Block a user