chore: update pipeline

This commit is contained in:
2026-05-03 20:24:18 +02:00
parent b1fa0ad608
commit 187ce1b187
4 changed files with 31 additions and 21 deletions
+12 -8
View File
@@ -2,11 +2,11 @@ name: Backend - Build & Lint
on: on:
push: push:
branches: [pre-prod] branches: [main, pre-prod]
paths: paths:
- "backend/**" - "backend/**"
pull_request: pull_request:
branches: [pre-prod] branches: [main, pre-prod]
paths: paths:
- "backend/**" - "backend/**"
@@ -58,7 +58,9 @@ jobs:
name: Docker Build & Push name: Docker Build & Push
needs: build needs: build
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/pre-prod' 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: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -79,7 +81,7 @@ jobs:
file: docker/backend/Dockerfile file: docker/backend/Dockerfile
target: runtime target: runtime
push: true push: true
tags: xor1234/backend-mln:latest tags: xor1234/backend-mln:${{ (github.ref == 'refs/heads/main' || github.base_ref == 'main') && 'latest' || 'pre-prod' }}
cache-from: type=gha,scope=backend-runtime cache-from: type=gha,scope=backend-runtime
cache-to: type=gha,mode=max,scope=backend-runtime cache-to: type=gha,mode=max,scope=backend-runtime
@@ -90,7 +92,7 @@ jobs:
file: docker/backend/Dockerfile file: docker/backend/Dockerfile
target: waf target: waf
push: true push: true
tags: xor1234/backend-mln:waf 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-from: type=gha,scope=backend-waf
cache-to: type=gha,mode=max,scope=backend-waf cache-to: type=gha,mode=max,scope=backend-waf
@@ -98,15 +100,17 @@ jobs:
name: Deploy to server name: Deploy to server
needs: docker needs: docker
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/pre-prod' 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: steps:
- name: SSH deploy - name: SSH deploy
uses: appleboy/ssh-action@v1 uses: appleboy/ssh-action@v1
with: with:
host: ${{ secrets.SERVER_HOST }} host: ${{ (github.ref == 'refs/heads/main' || github.base_ref == 'main') && secrets.SERVER_HOST_PROD || secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USER }} username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SERVER_SSH_KEY }} key: ${{ (github.ref == 'refs/heads/main' || github.base_ref == 'main') && secrets.SERVER_SSH_KEY_PROD || secrets.SERVER_SSH_KEY }}
script: | script: |
docker compose -f ${{ secrets.COMPOSE_PATH }} pull backend waf docker compose -f ${{ secrets.COMPOSE_PATH }} pull backend waf
docker compose -f ${{ secrets.COMPOSE_PATH }} up -d --no-deps backend waf docker compose -f ${{ secrets.COMPOSE_PATH }} up -d --no-deps backend waf
+5 -4
View File
@@ -2,11 +2,11 @@ name: Frontend Admin - EAS Build
on: on:
push: push:
branches: [pre-prod] branches: [main, pre-prod]
paths: paths:
- "frontend-admin/**" - "frontend-admin/**"
pull_request: pull_request:
branches: [pre-prod] branches: [main, pre-prod]
paths: paths:
- "frontend-admin/**" - "frontend-admin/**"
@@ -32,9 +32,10 @@ jobs:
working-directory: frontend-admin working-directory: frontend-admin
run: npx tsc --noEmit run: npx tsc --noEmit
build-apk-prod: build-apk-pre-prod:
needs: typecheck needs: typecheck
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/pre-prod'
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -66,7 +67,7 @@ jobs:
working-directory: frontend-admin working-directory: frontend-admin
env: env:
EAS_BUILD_NO_EXPO_GO_WARNING: true EAS_BUILD_NO_EXPO_GO_WARNING: true
run: eas build --platform android --profile production --non-interactive run: eas build --platform android --profile pre-production --non-interactive
- name: Download production APK - name: Download production APK
working-directory: frontend-admin working-directory: frontend-admin
+3 -2
View File
@@ -2,11 +2,11 @@ name: Frontend Client - EAS Build
on: on:
push: push:
branches: [pre-prod] branches: [main, pre-prod]
paths: paths:
- "mobile/**" - "mobile/**"
pull_request: pull_request:
branches: [pre-prod] branches: [main, pre-prod]
paths: paths:
- "mobile/**" - "mobile/**"
@@ -35,6 +35,7 @@ jobs:
build-apk-prod: build-apk-prod:
needs: typecheck needs: typecheck
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/pre-prod'
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
+11 -7
View File
@@ -2,12 +2,12 @@ name: Frontend Web - Build & Lint
on: on:
push: push:
branches: [pre-prod] branches: [main, pre-prod]
paths: paths:
- "frontend-prep/**" - "frontend-prep/**"
- "docker/frontend/**" - "docker/frontend/**"
pull_request: pull_request:
branches: [pre-prod] branches: [main, pre-prod]
paths: paths:
- "frontend-prep/**" - "frontend-prep/**"
- "docker/frontend/**" - "docker/frontend/**"
@@ -68,7 +68,9 @@ jobs:
name: Docker Build & Push name: Docker Build & Push
needs: build needs: build
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/pre-prod' 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: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -88,7 +90,7 @@ jobs:
context: . context: .
file: docker/frontend/Dockerfile file: docker/frontend/Dockerfile
push: true push: true
tags: xor1234/frontend-mln:latest tags: xor1234/frontend-mln:${{ (github.ref == 'refs/heads/main' || github.base_ref == 'main') && 'latest' || 'pre-prod' }}
build-args: | build-args: |
VITE_TOMTOM_API_KEY=${{ secrets.VITE_TOMTOM_API_KEY }} VITE_TOMTOM_API_KEY=${{ secrets.VITE_TOMTOM_API_KEY }}
@@ -96,15 +98,17 @@ jobs:
name: Deploy to server name: Deploy to server
needs: docker needs: docker
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/pre-prod' 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: steps:
- name: SSH deploy - name: SSH deploy
uses: appleboy/ssh-action@v1 uses: appleboy/ssh-action@v1
with: with:
host: ${{ secrets.SERVER_HOST }} host: ${{ (github.ref == 'refs/heads/main' || github.base_ref == 'main') && secrets.SERVER_HOST_PROD || secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USER }} username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SERVER_SSH_KEY }} key: ${{ (github.ref == 'refs/heads/main' || github.base_ref == 'main') && secrets.SERVER_SSH_KEY_PROD || secrets.SERVER_SSH_KEY }}
script: | script: |
docker compose -f ${{ secrets.COMPOSE_PATH }} pull frontend docker compose -f ${{ secrets.COMPOSE_PATH }} pull frontend
docker compose -f ${{ secrets.COMPOSE_PATH }} up -d --no-deps frontend docker compose -f ${{ secrets.COMPOSE_PATH }} up -d --no-deps frontend