- backend-build.yml / frontend-web-build.yml: le chemin des Dockerfile était codé en dur sur docker-prod/..., inexistant sur pre-prod (seul docker-pre-prod/ existe sur cette branche) — rendu conditionnel selon la branche cible, comme le tag Docker l'est déjà. - frontend-admin-build-local.yml: l'étape de publication OTA (Xavia) injectait une EXPO_PUBLIC_API_URL différente de celle utilisée pour builder l'APK (ota_api_url pointait vers https://5.181.0.112.nip.io au lieu de PREPROD_API_URL) — toute mise à jour OTA publiée sur le canal admin pre-prod embarquait donc une mauvaise URL d'API, provoquant un "Network Error" au login après réception de l'update, alors que l'APK fraîchement buildé fonctionnait. Alignée sur mobile qui n'avait pas ce bug.
65 lines
2.3 KiB
YAML
65 lines
2.3 KiB
YAML
name: Frontend Web - Build & Lint
|
|
|
|
on:
|
|
push:
|
|
branches: [main, pre-prod]
|
|
paths:
|
|
- "frontend-prep/**"
|
|
- "docker-pre-prod/frontend/**"
|
|
pull_request:
|
|
branches: [main, pre-prod]
|
|
paths:
|
|
- "frontend-prep/**"
|
|
- "docker-pre-prod/frontend/**"
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: npm
|
|
cache-dependency-path: frontend-prep/package-lock.json
|
|
|
|
- name: Install dependencies
|
|
working-directory: frontend-prep
|
|
run: npm ci
|
|
|
|
- name: Typecheck & lint
|
|
working-directory: frontend-prep
|
|
run: |
|
|
npx tsc -b --noEmit
|
|
npm run lint
|
|
|
|
- name: Build
|
|
working-directory: frontend-prep
|
|
env:
|
|
VITE_TOMTOM_API_KEY: ${{ secrets.VITE_TOMTOM_API_KEY }}
|
|
run: npm run build
|
|
|
|
- name: Login to Docker Hub
|
|
if: github.event_name == 'push' || github.event_name == 'pull_request'
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Set up Docker Buildx
|
|
if: github.event_name == 'push' || github.event_name == 'pull_request'
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Build & push frontend
|
|
if: github.event_name == 'push' || github.event_name == 'pull_request'
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: ${{ (github.ref == 'refs/heads/main' || github.base_ref == 'main') && 'docker-prod/frontend/Dockerfile' || 'docker-pre-prod/frontend/Dockerfile' }}
|
|
push: true
|
|
tags: xor1234/frontend-mln:${{ (github.ref == 'refs/heads/main' || github.base_ref == 'main') && 'latest' || 'pre-prod' }}
|
|
build-args: |
|
|
VITE_TOMTOM_API_KEY=${{ secrets.VITE_TOMTOM_API_KEY }}
|