chore: update ci

This commit is contained in:
2026-06-18 22:43:42 +02:00
parent af9092fa34
commit 5a77bacb04
4 changed files with 77 additions and 221 deletions
+14 -51
View File
@@ -13,37 +13,8 @@ on:
- "docker-pre-prod/frontend/**"
jobs:
lint-typecheck:
name: Lint & Typecheck
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
working-directory: frontend-prep
run: npx tsc -b --noEmit
- name: Lint
working-directory: frontend-prep
run: npm run lint
build:
name: Build
needs: lint-typecheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@@ -58,33 +29,31 @@ jobs:
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
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'))
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- 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: .
@@ -94,14 +63,8 @@ jobs:
build-args: |
VITE_TOMTOM_API_KEY=${{ secrets.VITE_TOMTOM_API_KEY }}
deploy:
name: Deploy to server
needs: docker
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- name: SSH deploy
- name: SSH Deploy
if: github.event_name == 'push'
uses: appleboy/ssh-action@v1
with:
host: ${{ (github.ref == 'refs/heads/main' || github.base_ref == 'main') && secrets.SERVER_HOST_PROD || secrets.SERVER_HOST_PRE_PROD }}