Retry 1225
Some checks failed
Build and Deploy / build-and-deploy (push) Failing after 19s

This commit is contained in:
2025-06-17 12:26:00 -03:00
parent 34dea2b413
commit e03359ffbd

View File

@@ -13,25 +13,38 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Build Backend Image and Save as Tar # --- NUEVO PASO: PREPARAMOS UN DIRECTORIO DE SALIDA PERSISTENTE ---
run: | - name: Create output directory
docker run --rm -v ${{ gitea.workspace }}:/workspace gcr.io/kaniko-project/executor:v1.9.0 \ run: mkdir -p ${{ gitea.workspace }}/output
--context=/workspace --dockerfile=/workspace/Backend/GestionIntegral.Api/Dockerfile \
--no-push --destination=${{ gitea.actor }}/${{ toLower(gitea.repository_name) }}-backend:latest \
--tarPath=/workspace/backend.tar
- name: Build Frontend Image and Save as Tar - name: Build Backend Image and Save to Output
run: | run: |
docker run --rm -v ${{ gitea.workspace }}:/workspace gcr.io/kaniko-project/executor:v1.9.0 \ docker run --rm \
--context=/workspace --dockerfile=/workspace/Frontend/Dockerfile \ -v ${{ gitea.workspace }}:/workspace \
--no-push --destination=${{ gitea.actor }}/${{ toLower(gitea.repository_name) }}-frontend:latest \ -v ${{ gitea.workspace }}/output:/output \
--tarPath=/workspace/frontend.tar gcr.io/kaniko-project/executor:v1.9.0 \
--context=/workspace \
--dockerfile=/workspace/Backend/GestionIntegral.Api/Dockerfile \
--no-push \
--destination=${{ gitea.actor }}/${{ toLower(gitea.repository_name) }}-backend:latest \
--tarPath=/output/backend.tar
# --- PASO DE DEPURACIÓN --- - name: Build Frontend Image and Save to Output
- name: Debug - List Workspace Contents
run: | run: |
echo "--- Listing contents of ${{ gitea.workspace }} ---" docker run --rm \
ls -lR ${{ gitea.workspace }} -v ${{ gitea.workspace }}:/workspace \
-v ${{ gitea.workspace }}/output:/output \
gcr.io/kaniko-project/executor:v1.9.0 \
--context=/workspace \
--dockerfile=/workspace/Frontend/Dockerfile \
--no-push \
--destination=${{ gitea.actor }}/${{ toLower(gitea.repository_name) }}-frontend:latest \
--tarPath=/output/frontend.tar
- name: Verify Artifacts
run: |
echo "--- Verifying contents of output directory ---"
ls -l ${{ gitea.workspace }}/output
- name: Deploy to Production via SCP and SSH - name: Deploy to Production via SCP and SSH
run: | run: |
@@ -44,7 +57,8 @@ jobs:
ssh-keyscan -H ${{ secrets.PROD_SERVER_HOST }} >> ~/.ssh/known_hosts ssh-keyscan -H ${{ secrets.PROD_SERVER_HOST }} >> ~/.ssh/known_hosts
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/ # Ahora copiamos desde el subdirectorio 'output'
scp ${{ gitea.workspace }}/output/backend.tar ${{ gitea.workspace }}/output/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..."
ssh ${{ secrets.PROD_SERVER_USER }}@${{ secrets.PROD_SERVER_HOST }} << 'EOF' ssh ${{ secrets.PROD_SERVER_USER }}@${{ secrets.PROD_SERVER_HOST }} << 'EOF'