-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (36 loc) · 1.42 KB
/
main.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Deploy to Render
on:
push:
branches:
- main # Adjust this branch as needed
jobs:
deploy:
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.11 # Replace with your Python version
- name: Install dependencies
run: pip install -r requirements.txt # Replace with your requirements file
- name: Re-train model on every push
run: python retrain.py # Replace with your training script
- name: Test model on custom inputs
run: pytest -p no:cacheprovider --disable-warnings
- name: Build Docker image
run: |
docker build -t credit_card_approval_predictor:latest .
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker tag credit_card_approval_predictor:latest sayam2801/credit_card_approval_predictor:latest
docker push sayam2801/credit_card_approval_predictor:latest
- name: Deploy to Render
run: |
curl -X POST -H "Authorization: Bearer ${{ secrets.RENDER_TOKEN }}" \
-H "Content-Type: application/json" \
--data '{
"image": "credit_card_approval_predictor:latest",
"serviceId": "srv-ckteii8168ec73bt59q0" # Replace with your Render service ID
}' \
https://api.render.com/v1/deploys