Agregar mejoras PWA y unificar workflow a 1 job
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 2m19s

- 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
This commit is contained in:
2025-10-17 03:28:35 -06:00
parent 9fcaf754ca
commit d155c69f59
2 changed files with 17 additions and 19 deletions

View File

@@ -5,12 +5,17 @@ on:
branches: [ main, master ] branches: [ main, master ]
jobs: jobs:
#───────────────── build & push ───────────────── #───────────────── build, push & deploy (unified) ─────────────────
build: build-and-deploy:
runs-on: docker runs-on: docker
env: env:
REG: ${{ vars.REGISTRY_URL }} REG: ${{ vars.REGISTRY_URL }}
APP_NAME: ${{ vars.APP_NAME }} 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: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2 - 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:${{ github.sha }}
docker push $REG/${{ github.repository_owner }}/$APP_NAME:latest 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 - name: Info about environment
run: | run: |
echo " Deploying ${{ vars.APP_NAME }}" echo " Deploying ${{ vars.APP_NAME }}"

View File

@@ -24,6 +24,7 @@ export default defineNuxtConfig({
registerType: 'autoUpdate', registerType: 'autoUpdate',
includeAssets: ['favicon.ico', 'apple-touch-icon.png', 'icon.svg', 'offline.html'], includeAssets: ['favicon.ico', 'apple-touch-icon.png', 'icon.svg', 'offline.html'],
manifest: { manifest: {
id: '/?app=whisper',
name: 'Nucleo Whisper', name: 'Nucleo Whisper',
short_name: 'Whisper', short_name: 'Whisper',
description: 'Aplicación de transcripción de audio usando OpenAI Whisper', description: 'Aplicación de transcripción de audio usando OpenAI Whisper',
@@ -34,8 +35,17 @@ export default defineNuxtConfig({
orientation: 'portrait', orientation: 'portrait',
scope: '/', scope: '/',
start_url: '/', start_url: '/',
// Control de ventanas - mantener una sola ventana
launch_handler: {
client_mode: 'navigate-existing'
},
// Capturar enlaces dentro de la app // Capturar enlaces dentro de la app
capture_links: 'existing-client-navigate', 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: [ icons: [
{ {
src: '/icon-192x192.png', src: '/icon-192x192.png',