From d155c69f594ae8289d38bd644ae56f3f62c7925d Mon Sep 17 00:00:00 2001 From: josedario87 Date: Fri, 17 Oct 2025 03:28:35 -0600 Subject: [PATCH] Agregar mejoras PWA y unificar workflow a 1 job MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Agregar id único (/?app=whisper), launch_handler, handle_links y url_handlers - Unificar workflow de 2 jobs (build + deploy) a 1 solo job - Workaround para bug de Gitea que solo ejecuta el primer job --- .gitea/workflows/build-and-deploy.yml | 26 +++++++------------------- nuxt4/nuxt.config.ts | 10 ++++++++++ 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/.gitea/workflows/build-and-deploy.yml b/.gitea/workflows/build-and-deploy.yml index 714a0d0..1b0100d 100644 --- a/.gitea/workflows/build-and-deploy.yml +++ b/.gitea/workflows/build-and-deploy.yml @@ -5,12 +5,17 @@ on: branches: [ main, master ] jobs: -#───────────────── build & push ───────────────── - build: +#───────────────── build, push & deploy (unified) ───────────────── + build-and-deploy: runs-on: docker env: REG: ${{ vars.REGISTRY_URL }} APP_NAME: ${{ vars.APP_NAME }} + REPO_OWNER: ${{ github.repository_owner }} + # Variables de entorno para docker-compose + APP_DOMAIN: ${{ vars.APP_DOMAIN }} + NUXT_PUBLIC_APP_URL: ${{ vars.NUXT_PUBLIC_APP_URL }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} steps: - uses: actions/checkout@v3 - uses: docker/setup-buildx-action@v2 @@ -27,23 +32,6 @@ jobs: docker push $REG/${{ github.repository_owner }}/$APP_NAME:${{ github.sha }} docker push $REG/${{ github.repository_owner }}/$APP_NAME:latest -#───────────────── deploy ───────────────── - deploy: - needs: build - runs-on: docker - env: - REG: ${{ vars.REGISTRY_URL }} - REPO_OWNER: ${{ github.repository_owner }} - APP_NAME: ${{ vars.APP_NAME }} - # Variables de entorno para docker-compose - APP_DOMAIN: ${{ vars.APP_DOMAIN }} - NUXT_PUBLIC_APP_URL: ${{ vars.NUXT_PUBLIC_APP_URL }} - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - steps: - - uses: actions/checkout@v3 - - name: Login to registry - run: docker login ${{ vars.REGISTRY_URL }} -u ${{ secrets.REGISTRY_USERNAME }} -p ${{ secrets.REGISTRY_PASSWORD }} - - name: Info about environment run: | echo "ℹ️ Deploying ${{ vars.APP_NAME }}" diff --git a/nuxt4/nuxt.config.ts b/nuxt4/nuxt.config.ts index 106b805..ad1b462 100644 --- a/nuxt4/nuxt.config.ts +++ b/nuxt4/nuxt.config.ts @@ -24,6 +24,7 @@ export default defineNuxtConfig({ registerType: 'autoUpdate', includeAssets: ['favicon.ico', 'apple-touch-icon.png', 'icon.svg', 'offline.html'], manifest: { + id: '/?app=whisper', name: 'Nucleo Whisper', short_name: 'Whisper', description: 'Aplicación de transcripción de audio usando OpenAI Whisper', @@ -34,8 +35,17 @@ export default defineNuxtConfig({ orientation: 'portrait', scope: '/', start_url: '/', + // Control de ventanas - mantener una sola ventana + launch_handler: { + client_mode: 'navigate-existing' + }, // Capturar enlaces dentro de la app capture_links: 'existing-client-navigate', + // URL handling - nuevo estándar para manejar links a esta PWA + handle_links: 'preferred', + url_handlers: [ + { origin: 'https://whisper.nucleoriofrio.com' } + ], icons: [ { src: '/icon-192x192.png',