diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1f6dc0..6b53ce3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,10 +4,28 @@ on: pull_request: branches: [main] push: - branches: [main, dev_noeline_beta] + branches: [main, dev_beta] jobs: + test_ingestion: + name: Tests Ingestion + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Installer les dépendances Python + working-directory: ingestion + run: | + python3 -m venv venv + source venv/bin/activate + pip install -r requirements.txt + - name: Run les tests + working-directory: ingestion + run: | + source venv/bin/activate + pytest tests/ -v + test-api: name: Tests API runs-on: ubuntu-latest @@ -81,12 +99,17 @@ jobs: build-images: - name: Build Docker Images + name: Build & Push Docker Images runs-on: ubuntu-latest needs: - test-api - test-front + - test_ingestion + + permissions: + contents: read + packages: write strategy: matrix: @@ -104,10 +127,19 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Build ${{ matrix.service }} - uses: docker/build-push-action@v5 + - name: Login to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push ${{ matrix.service }} + uses: docker/build-push-action@v6 with: context: . file: ${{ matrix.dockerfile }} - push: false - tags: ${{ matrix.service }}:test \ No newline at end of file + push: true + tags: | + ghcr.io/${{ github.repository_owner }}/dora_beta-${{ matrix.service }}:latest + ghcr.io/${{ github.repository_owner }}/dora_beta-${{ matrix.service }}:${{ github.sha }} \ No newline at end of file