From a84d46a82e5da1912466941a7cdb1118dc0b9bfd Mon Sep 17 00:00:00 2001 From: Daniel Andarge Date: Wed, 26 Jun 2024 22:13:51 +0300 Subject: [PATCH] Update ci-cd.yml --- .github/workflows/ci-cd.yml | 64 ------------------------------------- 1 file changed, 64 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index a8fd038..8b13789 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -1,65 +1 @@ -name: CI/CD Pipeline -on: - push: - branches: - - main - pull_request: - branches: - - main - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.10 - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - - name: Lint with flake8 - run: | - pip install flake8 - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - - name: Test with pytest - run: | - pip install pytest - pytest - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build and push Docker image - uses: docker/build-push-action@v2 - with: - context: . - push: true - tags: ${{ secrets.DOCKER_USERNAME }}/fraud-detection-model:latest - - - name: Deploy to Heroku - env: - HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} - run: | - curl https://cli-assets.heroku.com/install.sh | sh - heroku container:login - heroku container:push web -a ${{ secrets.HEROKU_APP_NAME }} - heroku container:release web -a ${{ secrets.HEROKU_APP_NAME }}