name: Backend - Build & Lint on: push: branches: [pre-prod] paths: - "backend/**" pull_request: branches: [pre-prod] paths: - "backend/**" jobs: lint: name: Static Analysis (golangci-lint) runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Setup Go uses: actions/setup-go@v5 with: go-version: "1.24.4" cache-dependency-path: backend/gestion/go.sum - name: golangci-lint uses: golangci/golangci-lint-action@v6 continue-on-error: true with: version: latest working-directory: backend/gestion args: --timeout=5m build: name: Build needs: lint runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Setup Go uses: actions/setup-go@v5 with: go-version: "1.24.4" cache-dependency-path: backend/gestion/go.sum - name: Download dependencies working-directory: backend/gestion run: go mod download - name: Build working-directory: backend/gestion run: go build -v ./... docker: name: Docker Build & Push needs: build runs-on: ubuntu-latest if: github.event_name == 'push' && github.ref == 'refs/heads/pre-prod' 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: Build & push backend (runtime) uses: docker/build-push-action@v6 with: context: . file: docker/backend/Dockerfile target: runtime push: true tags: | xor1234/backend-mln:latest - name: Build & push WAF uses: docker/build-push-action@v6 with: context: . file: docker/backend/Dockerfile target: waf push: true tags: | xor1234/backend-mln:waf