chore: add CD

This commit is contained in:
2026-05-02 18:10:33 +02:00
parent a9d8fb5297
commit 90a23b065b
2 changed files with 41 additions and 6 deletions
+23 -4
View File
@@ -79,8 +79,9 @@ jobs:
file: docker/backend/Dockerfile file: docker/backend/Dockerfile
target: runtime target: runtime
push: true push: true
tags: | tags: xor1234/backend-mln:latest
xor1234/backend-mln:latest cache-from: type=gha,scope=backend-runtime
cache-to: type=gha,mode=max,scope=backend-runtime
- name: Build & push WAF - name: Build & push WAF
uses: docker/build-push-action@v6 uses: docker/build-push-action@v6
@@ -89,5 +90,23 @@ jobs:
file: docker/backend/Dockerfile file: docker/backend/Dockerfile
target: waf target: waf
push: true push: true
tags: | tags: xor1234/backend-mln:waf
xor1234/backend-mln:waf cache-from: type=gha,scope=backend-waf
cache-to: type=gha,mode=max,scope=backend-waf
deploy:
name: Deploy to server
needs: docker
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/pre-prod'
steps:
- name: SSH deploy
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USER }}
key: ${{ 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
+18 -2
View File
@@ -88,7 +88,23 @@ jobs:
context: . context: .
file: docker/frontend/Dockerfile file: docker/frontend/Dockerfile
push: true push: true
tags: | tags: xor1234/frontend-mln:latest
xor1234/frontend-mln:latest
build-args: | build-args: |
VITE_TOMTOM_API_KEY=${{ secrets.VITE_TOMTOM_API_KEY }} 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' && github.ref == 'refs/heads/pre-prod'
steps:
- name: SSH deploy
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SERVER_SSH_KEY }}
script: |
docker compose -f ${{ secrets.COMPOSE_PATH }} pull frontend
docker compose -f ${{ secrets.COMPOSE_PATH }} up -d --no-deps frontend