From 329c411def60d2be5ca9f18323e937a6559d5c8c Mon Sep 17 00:00:00 2001 From: Ignacio Tula Date: Wed, 11 Sep 2024 02:35:46 -0300 Subject: [PATCH] Devops (#20) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * KAN-27 Feature: redef del paso 1 prod * KAN-27 Fix Errores en Dockerfile y Feature segunda etapa despliegue * KAN-27 Refactor: CD en un solo archivo * KAN-27 Fix checkout on prod api server y nueva action de firebase deploy * KAN-27 Detectar error de permiso docker y segundo intento de firebase deploy * nuevos permisos * Por qué lee el docker-compose de dev en vez de el generico? * KAN-27 API de fotos cargado en Github Secrets --- .github/workflows/dev-push.yml | 1 + .github/workflows/prod-build.yml | 24 +++++++++--------------- docker-compose-dev.yml | 2 ++ 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/.github/workflows/dev-push.yml b/.github/workflows/dev-push.yml index 2d3c6bb..ce4c79f 100644 --- a/.github/workflows/dev-push.yml +++ b/.github/workflows/dev-push.yml @@ -106,5 +106,6 @@ jobs: EMAIL_SMTP_USER: ${{ secrets.EMAIL_SMTP_USER }} EMAIL_SMTP_PASSWORD: ${{ secrets.EMAIL_SMTP_PASSWORD }} EMAIL_SMTP_SERVER: ${{ secrets.EMAIL_SMTP_SERVER }} + VITE_BASE_URL: ${{ secrets.VITE_BASE_URL }} TEST: "true" run: docker-compose -f docker-compose-dev.yml -p dm-nms up -d diff --git a/.github/workflows/prod-build.yml b/.github/workflows/prod-build.yml index 3339e83..7b6136b 100644 --- a/.github/workflows/prod-build.yml +++ b/.github/workflows/prod-build.yml @@ -29,7 +29,9 @@ jobs: run: npm install - name: Buildear client working-directory: ./client - run: npm run build + run: npm run build + env: + VITE_API_KEY: ${{ secrets.VITE_API_KEY }} build-admin: @@ -45,23 +47,13 @@ jobs: - name: Buildear admin working-directory: ./admin run: npm run build + - deploy-client: - runs-on: potus - needs: build-client - steps: - - uses: FirebaseExtended/action-hosting-deploy@v0 - with: - firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}" - projectId: nms-devmaster - channelId: live - target: web-client - - deploy-admin: + deploy-front: runs-on: potus - needs: build-admin + needs: [build-admin, build-client] steps: - uses: lowply/deploy-firebase@v0.0.5 env: @@ -105,5 +97,7 @@ jobs: EMAIL_SMTP_USER: ${{ secrets.EMAIL_SMTP_USER }} EMAIL_SMTP_PASSWORD: ${{ secrets.EMAIL_SMTP_PASSWORD }} EMAIL_SMTP_SERVER: ${{ secrets.EMAIL_SMTP_SERVER }} + VITE_BASE_URL: ${{ secrets.VITE_BASE_URL }} TEST: "true" - run: docker-compose -f docker-compose-prod.yml -p dm-nms up -d \ No newline at end of file + run: docker-compose -f docker-compose-prod.yml -p dm-nms up -d + diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index cbdd6a0..afce4a5 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -26,6 +26,8 @@ services: restart: unless-stopped ports: - "5173:5173" + environment: + - VITE_BASE_URL=${VITE_BASE_URL} networks: default: