CI/CD moved to the right path
This commit is contained in:
parent
a6a30e21b3
commit
76b7eca690
1 changed files with 0 additions and 53 deletions
53
.github/workflows/ci-cd.yml
vendored
53
.github/workflows/ci-cd.yml
vendored
|
|
@ -1,53 +0,0 @@
|
||||||
name: CI/CD Pipeline
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v4
|
|
||||||
with:
|
|
||||||
python-version: '3.12'
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install -r deployment/api/requirements.txt
|
|
||||||
|
|
||||||
- name: Run unit tests
|
|
||||||
run: |
|
|
||||||
pytest tests/ # adapte le chemin à ton dossier de tests
|
|
||||||
|
|
||||||
build_and_push:
|
|
||||||
needs: test
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: success()
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Log in to Docker Hub
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Build and push Docker image
|
|
||||||
uses: docker/build-push-action@v4
|
|
||||||
with:
|
|
||||||
context: ./deployment/api
|
|
||||||
file: ./deployment/api/Dockerfile
|
|
||||||
push: true
|
|
||||||
tags: yourdockerhubusername/sentiment_api:latest
|
|
||||||
|
|
||||||
|
|
||||||
Loading…
Add table
Reference in a new issue