no message

This commit is contained in:
2025-06-17 12:45:55 -03:00
parent e84a6fb531
commit a7c8944e78

View File

@@ -12,6 +12,7 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
<<<<<<< HEAD
- name: Build Backend Image and Extract - name: Build Backend Image and Extract
run: | run: |
@@ -59,6 +60,37 @@ jobs:
- name: Deploy to Production via SCP and SSH - name: Deploy to Production via SCP and SSH
run: | run: |
=======
# Ya no necesitamos crear config.json. La acción de login lo maneja.
- name: Login to Gitea Registry
uses: docker/login-action@v2
with:
registry: 127.0.0.1:5000
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.ACTIONS_PAT }}
- name: Build and Push Backend
uses: docker/build-push-action@v4
with:
context: .
file: Backend/GestionIntegral.Api/Dockerfile
push: true
# La imagen se etiqueta para el registro local
tags: 127.0.0.1:5000/dmolinari/gestionintegralweb-backend:latest,127.0.0.1:5000/dmolinari/gestionintegralweb-backend:${{ gitea.sha_short }}
- name: Build and Push Frontend
uses: docker/build-push-action@v4
with:
context: .
file: Frontend/Dockerfile
push: true
tags: 127.0.0.1:5000/dmolinari/gestionintegralweb-frontend:latest,127.0.0.1:5000/dmolinari/gestionintegralweb-frontend:${{ gitea.sha_short }}
# El despliegue ahora es un paso final en el mismo job
- name: Deploy to Production via SSH
run: |
>>>>>>> 2d44116 (Retry 1243)
set -e set -e
echo "Preparing SSH client..." echo "Preparing SSH client..."
apt-get update && apt-get install -y openssh-client apt-get update && apt-get install -y openssh-client
@@ -67,10 +99,14 @@ jobs:
chmod 600 ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.PROD_SERVER_HOST }} >> ~/.ssh/known_hosts ssh-keyscan -H ${{ secrets.PROD_SERVER_HOST }} >> ~/.ssh/known_hosts
<<<<<<< HEAD
echo "Copying image files to production server..." echo "Copying image files to production server..."
scp ${{ gitea.workspace }}/backend.tar ${{ gitea.workspace }}/frontend.tar ${{ secrets.PROD_SERVER_USER }}@${{ secrets.PROD_SERVER_HOST }}:/opt/gestion-integral/ scp ${{ gitea.workspace }}/backend.tar ${{ gitea.workspace }}/frontend.tar ${{ secrets.PROD_SERVER_USER }}@${{ secrets.PROD_SERVER_HOST }}:/opt/gestion-integral/
echo "Connecting to host to load images and deploy..." echo "Connecting to host to load images and deploy..."
=======
echo "Connecting to host to deploy..."
>>>>>>> 2d44116 (Retry 1243)
ssh ${{ secrets.PROD_SERVER_USER }}@${{ secrets.PROD_SERVER_HOST }} << 'EOF' ssh ${{ secrets.PROD_SERVER_USER }}@${{ secrets.PROD_SERVER_HOST }} << 'EOF'
set -e set -e
echo "--- CONECTADO AL SERVIDOR DE PRODUCCIÓN ---" echo "--- CONECTADO AL SERVIDOR DE PRODUCCIÓN ---"
@@ -83,6 +119,15 @@ jobs:
echo "Starting application stack..." echo "Starting application stack..."
export DB_SA_PASSWORD="${{ secrets.DB_SA_PASSWORD_SECRET }}" export DB_SA_PASSWORD="${{ secrets.DB_SA_PASSWORD_SECRET }}"
export JWT_KEY="${{ secrets.JWT_KEY_SECRET }}" export JWT_KEY="${{ secrets.JWT_KEY_SECRET }}"
<<<<<<< HEAD
=======
# El login ya no es necesario aquí, el demonio ya tiene la sesión
# del paso anterior del pipeline. Pero lo dejamos por robustez.
echo "${{ secrets.ACTIONS_PAT }}" | docker login 127.0.0.1:5000 -u ${{ secrets.REGISTRY_USER }} --password-stdin
docker compose pull
>>>>>>> 2d44116 (Retry 1243)
docker compose up -d docker compose up -d
echo "Cleaning up tar files and old images..." echo "Cleaning up tar files and old images..."