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