chore: update pipeline
This commit is contained in:
@@ -2,11 +2,11 @@ name: Backend - Build & Lint
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [pre-prod]
|
||||
branches: [main, pre-prod]
|
||||
paths:
|
||||
- "backend/**"
|
||||
pull_request:
|
||||
branches: [pre-prod]
|
||||
branches: [main, pre-prod]
|
||||
paths:
|
||||
- "backend/**"
|
||||
|
||||
@@ -58,7 +58,9 @@ jobs:
|
||||
name: Docker Build & Push
|
||||
needs: build
|
||||
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:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -79,7 +81,7 @@ jobs:
|
||||
file: docker/backend/Dockerfile
|
||||
target: runtime
|
||||
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-to: type=gha,mode=max,scope=backend-runtime
|
||||
|
||||
@@ -90,7 +92,7 @@ jobs:
|
||||
file: docker/backend/Dockerfile
|
||||
target: waf
|
||||
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-to: type=gha,mode=max,scope=backend-waf
|
||||
|
||||
@@ -98,15 +100,17 @@ jobs:
|
||||
name: Deploy to server
|
||||
needs: docker
|
||||
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:
|
||||
- name: SSH deploy
|
||||
uses: appleboy/ssh-action@v1
|
||||
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 }}
|
||||
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: |
|
||||
docker compose -f ${{ secrets.COMPOSE_PATH }} pull backend waf
|
||||
docker compose -f ${{ secrets.COMPOSE_PATH }} up -d --no-deps backend waf
|
||||
|
||||
@@ -2,11 +2,11 @@ name: Frontend Admin - EAS Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [pre-prod]
|
||||
branches: [main, pre-prod]
|
||||
paths:
|
||||
- "frontend-admin/**"
|
||||
pull_request:
|
||||
branches: [pre-prod]
|
||||
branches: [main, pre-prod]
|
||||
paths:
|
||||
- "frontend-admin/**"
|
||||
|
||||
@@ -32,9 +32,10 @@ jobs:
|
||||
working-directory: frontend-admin
|
||||
run: npx tsc --noEmit
|
||||
|
||||
build-apk-prod:
|
||||
build-apk-pre-prod:
|
||||
needs: typecheck
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/pre-prod'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -66,7 +67,7 @@ jobs:
|
||||
working-directory: frontend-admin
|
||||
env:
|
||||
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
|
||||
working-directory: frontend-admin
|
||||
|
||||
@@ -2,11 +2,11 @@ name: Frontend Client - EAS Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [pre-prod]
|
||||
branches: [main, pre-prod]
|
||||
paths:
|
||||
- "mobile/**"
|
||||
pull_request:
|
||||
branches: [pre-prod]
|
||||
branches: [main, pre-prod]
|
||||
paths:
|
||||
- "mobile/**"
|
||||
|
||||
@@ -35,6 +35,7 @@ jobs:
|
||||
build-apk-prod:
|
||||
needs: typecheck
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/pre-prod'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@@ -2,12 +2,12 @@ name: Frontend Web - Build & Lint
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [pre-prod]
|
||||
branches: [main, pre-prod]
|
||||
paths:
|
||||
- "frontend-prep/**"
|
||||
- "docker/frontend/**"
|
||||
pull_request:
|
||||
branches: [pre-prod]
|
||||
branches: [main, pre-prod]
|
||||
paths:
|
||||
- "frontend-prep/**"
|
||||
- "docker/frontend/**"
|
||||
@@ -68,7 +68,9 @@ jobs:
|
||||
name: Docker Build & Push
|
||||
needs: build
|
||||
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:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -88,7 +90,7 @@ jobs:
|
||||
context: .
|
||||
file: docker/frontend/Dockerfile
|
||||
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: |
|
||||
VITE_TOMTOM_API_KEY=${{ secrets.VITE_TOMTOM_API_KEY }}
|
||||
|
||||
@@ -96,15 +98,17 @@ jobs:
|
||||
name: Deploy to server
|
||||
needs: docker
|
||||
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:
|
||||
- name: SSH deploy
|
||||
uses: appleboy/ssh-action@v1
|
||||
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 }}
|
||||
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: |
|
||||
docker compose -f ${{ secrets.COMPOSE_PATH }} pull frontend
|
||||
docker compose -f ${{ secrets.COMPOSE_PATH }} up -d --no-deps frontend
|
||||
|
||||
Reference in New Issue
Block a user