Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cd.yml and dockerfile #5

Merged
merged 10 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/api-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: API-CD

on:
push:
branches:
- 'main'

env:
WORKING_DIR: ./api

jobs:
build-and-push:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ${{ env.WORKING_DIR }}
steps:
- name: Checkout code
uses: actions/checkout@v2

# - name: Login to Docker Hub
# run: echo "${{ secrets.DOCKERHUB_PUSH_TOKEN }}" | docker login -u muzammil360 --password-stdin

- name: Login, Build and push Docker image
run: |
echo "${{ secrets.DOCKERHUB_PUSH_TOKEN }}" | docker login -u muzammil360 --password-stdin
docker build -t muzammil360/ml-kubernetes:latest .
docker push muzammil360/ml-kubernetes:latest
3 changes: 1 addition & 2 deletions .github/workflows/api-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Python application
name: API-CI

on:
pull_request:
Expand All @@ -11,7 +11,6 @@ env:

jobs:
build:

runs-on: ubuntu-latest
defaults:
run:
Expand Down
12 changes: 12 additions & 0 deletions api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM python:3.8-slim

WORKDIR /app
RUN pip install --upgrade pip

COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt

COPY . /app
RUN python download_weights.py

CMD ["uvicorn","server:app"]
Loading