Skip to content

Commit

Permalink
adding cd
Browse files Browse the repository at this point in the history
  • Loading branch information
Rudiio committed Dec 11, 2023
1 parent efd1101 commit 537a4a0
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ on:
branches:
- main
- dev
- ci/cd
pull_request:
branches:
- main
- dev
jobs:
build:
ci:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -30,4 +31,26 @@ jobs:
run : python -m dvc pull -r origin

- name: Run tests
run: python -m pytest
run: python -m pytest

cd:
runs-on: ubuntu-latest
needs : ci
steps :
- name : Checkout repository
uses: actions/checkout@v4

- name: Docker login
run: docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} -p ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Build
run: docker build -t back .
- name: Tags
run: |
docker tag back ${{ secrets.DOCKER_HUB_USERNAME }}/back:${{ github.sha }}
docker tag back ${{ secrets.DOCKER_HUB_USERNAME }}/back:latest
- name: Push
run: |
docker push ${{ secrets.DOCKER_HUB_USERNAME }}/back:${{ github.sha }}
docker push ${{ secrets.DOCKER_HUB_USERNAME }}/back:latest

0 comments on commit 537a4a0

Please sign in to comment.