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

- Agregar id único (/?app=analitica), 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:32:13 -06:00
parent f00fa92616
commit 62ecab25f5
2 changed files with 25 additions and 27 deletions

View File

@@ -5,31 +5,8 @@ on:
branches: [ main, master ] branches: [ main, master ]
jobs: jobs:
#───────────────── build & push ───────────────── #───────────────── build, push & deploy (unified) ─────────────────
build: build-and-deploy:
runs-on: docker
env:
REG: ${{ vars.REGISTRY_URL }}
APP_NAME: ${{ vars.APP_NAME }}
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
registry: ${{ vars.REGISTRY_URL }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build+push ${{ vars.APP_NAME }}
run: |
cd nuxt4-app
docker build -t $REG/${{ github.repository_owner }}/$APP_NAME:${{ github.sha }} -t $REG/${{ github.repository_owner }}/$APP_NAME:latest .
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 runs-on: docker
env: env:
REG: ${{ vars.REGISTRY_URL }} REG: ${{ vars.REGISTRY_URL }}
@@ -49,8 +26,19 @@ jobs:
METABASE_PASSWORD: ${{ secrets.METABASE_PASSWORD }} METABASE_PASSWORD: ${{ secrets.METABASE_PASSWORD }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Login to registry - uses: docker/setup-buildx-action@v2
run: docker login ${{ vars.REGISTRY_URL }} -u ${{ secrets.REGISTRY_USERNAME }} -p ${{ secrets.REGISTRY_PASSWORD }} - uses: docker/login-action@v2
with:
registry: ${{ vars.REGISTRY_URL }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build+push ${{ vars.APP_NAME }}
run: |
cd nuxt4-app
docker build -t $REG/${{ github.repository_owner }}/$APP_NAME:${{ github.sha }} -t $REG/${{ github.repository_owner }}/$APP_NAME:latest .
docker push $REG/${{ github.repository_owner }}/$APP_NAME:${{ github.sha }}
docker push $REG/${{ github.repository_owner }}/$APP_NAME:latest
- name: Info about environment - name: Info about environment
run: | run: |

View File

@@ -81,6 +81,7 @@ export default defineNuxtConfig({
strategies: 'generateSW', strategies: 'generateSW',
manifestFilename: 'manifest.webmanifest', manifestFilename: 'manifest.webmanifest',
manifest: { manifest: {
id: '/?app=analitica',
name: 'Analítica Núcleo Data Studio', name: 'Analítica Núcleo Data Studio',
short_name: 'Analítica', short_name: 'Analítica',
description: 'Explora y valida tus tablas Supabase desde un único panel en modo lectura.', description: 'Explora y valida tus tablas Supabase desde un único panel en modo lectura.',
@@ -89,8 +90,17 @@ export default defineNuxtConfig({
display: 'standalone', display: 'standalone',
background_color: '#1b1209', background_color: '#1b1209',
theme_color: '#c08040', theme_color: '#c08040',
// 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://analitica.nucleoriofrio.com' }
],
icons: [ icons: [
{ src: '/icons/icon-192.png', sizes: '192x192', type: 'image/png' }, { src: '/icons/icon-192.png', sizes: '192x192', type: 'image/png' },
{ src: '/icons/icon-512.png', sizes: '512x512', type: 'image/png' }, { src: '/icons/icon-512.png', sizes: '512x512', type: 'image/png' },