chore: fix

This commit is contained in:
2026-05-03 20:52:23 +02:00
parent afbe18b896
commit 60192f3748
9 changed files with 36 additions and 48 deletions
+18 -20
View File
@@ -2,13 +2,13 @@ name: Backend - Build & Lint
on:
push:
branches: [main, pre-prod]
branches: [main]
paths:
- "backend/**"
- "backend/**/**"
pull_request:
branches: [main, pre-prod]
branches: [main]
paths:
- "backend/**"
- "backend/**/**"
jobs:
lint:
@@ -54,26 +54,31 @@ jobs:
working-directory: backend/gestion
run: go build -v ./...
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: backend-binary
path: backend/gestion/gestion
retention-days: 7
docker:
name: Docker Build & Push
needs: build
runs-on: ubuntu-latest
if: >
(github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/pre-prod')) ||
(github.event_name == 'pull_request' && (github.base_ref == 'main' || github.base_ref == 'pre-prod'))
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build & push backend (runtime)
uses: docker/build-push-action@v6
with:
@@ -81,9 +86,7 @@ jobs:
file: docker/backend/Dockerfile
target: runtime
push: true
tags: xor1234/backend-mln:${{ (github.ref == 'refs/heads/main' || github.base_ref == 'main') && 'latest' || 'pre-prod' }}
cache-from: type=gha,scope=backend-runtime
cache-to: type=gha,mode=max,scope=backend-runtime
tags: xor1234/backend-mln:latest
- name: Build & push WAF
uses: docker/build-push-action@v6
@@ -92,17 +95,12 @@ jobs:
file: docker/backend/Dockerfile
target: waf
push: true
tags: xor1234/backend-mln:${{ (github.ref == 'refs/heads/main' || github.base_ref == 'main') && 'waf' || 'waf-pre-prod' }}
cache-from: type=gha,scope=backend-waf
cache-to: type=gha,mode=max,scope=backend-waf
tags: xor1234/backend-mln:waf
deploy:
name: Deploy to server
name: SSH Deploy
needs: docker
runs-on: ubuntu-latest
if: >
(github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/pre-prod')) ||
(github.event_name == 'pull_request' && (github.base_ref == 'main' || github.base_ref == 'pre-prod'))
steps:
- name: SSH deploy
+5 -6
View File
@@ -32,10 +32,9 @@ jobs:
working-directory: frontend-admin
run: npx tsc --noEmit
build-apk-pre-prod:
build-apk:
needs: typecheck
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/pre-prod'
steps:
- uses: actions/checkout@v4
@@ -63,13 +62,13 @@ jobs:
jq '.expo.extra.eas.projectId = "${{ secrets.EXPO_PROJECT_ID }}"' app.json > app.tmp.json
mv app.tmp.json app.json
- name: Build production APK
working-directory: frontend-admin
- name: Build APK
working-directory: mobile
env:
EAS_BUILD_NO_EXPO_GO_WARNING: true
run: eas build --platform android --profile pre-production --non-interactive
run: eas build --platform android ${{ (github.ref == 'refs/heads/main' || github.base_ref == 'main') && '--profile production' || '--profile preview' }} --non-interactive
- name: Download production APK
- name: Download APK
working-directory: frontend-admin
run: |
APK_URL=$(eas build:list --platform android --status finished --limit 1 --json --non-interactive | jq -r '.[0].artifacts.buildUrl')
+3 -4
View File
@@ -32,10 +32,9 @@ jobs:
working-directory: mobile
run: npx tsc --noEmit
build-apk-prod:
build-apk:
needs: typecheck
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/pre-prod'
steps:
- uses: actions/checkout@v4
@@ -67,11 +66,11 @@ jobs:
working-directory: mobile
run: cat app.json
- name: Build production APK
- name: Build APK
working-directory: mobile
env:
EAS_BUILD_NO_EXPO_GO_WARNING: true
run: eas build --platform android --profile production --non-interactive
run: ${{ (github.ref == 'refs/heads/main' || github.base_ref == 'main') && --profile production || --profile preview }} eas build --platform android --profile production --non-interactive
- name: Download production APK
working-directory: mobile
-3
View File
@@ -98,9 +98,6 @@ jobs:
name: Deploy to server
needs: docker
runs-on: ubuntu-latest
if: >
(github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/pre-prod')) ||
(github.event_name == 'pull_request' && (github.base_ref == 'main' || github.base_ref == 'pre-prod'))
steps:
- name: SSH deploy