Skip to content

update ci workflow

update ci workflow #17

name: Python CI/CD
on:
pull_request:
branches: [ main ]
paths:
- 'backAgent/**'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Deploy to Render
run: >
curl -X POST -H 'Authorization: Bearer ${{ secrets.RENDER_API_KEY }}' -d ''
https://api.render.com/deploy/srv-cmikfaq1hbls738fek40?key=JPyNNIsvXdk
check-deployment:
runs-on: ubuntu-latest
needs: build-and-deploy
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10.12'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install requests
- name: Check Deployment Status on Render
run: python backAgent/tests/check_deployment_status.py
env:
RENDER_API_KEY: ${{ secrets.RENDER_API_KEY }}
SERVICE_ID: 'srv-cmikfaq1hbls738fek40'
test-server:
runs-on: ubuntu-latest
needs: check-deployment
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10.12'
- name: Install dependencies
run: |
cd backAgent
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run tests
run: |
cd backAgent
python -m pytest