Skip to content

Testactions

Testactions #13

name: Test Production
on:
pull_request:
branches:
- main
jobs:
test-production:
runs-on: ubuntu-latest
env:
db_name: ${{ secrets.DB_NAME }}
MONGO_URI_NAACP: ${{ secrets.MONGO_URI_NAACP }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r ./se_ml_production/ML_backend_GKE/ML_GKE/ML_Service_GKE/requirements.txt
- name: Google Auth
id: auth
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
- name: Run deployment
id: deployment
run: |
python ./se_ml_production/ML_backend_GKE/ML_GKE/ML_Service_GKE/main.py
if grep -q "Deployment Test Comlpete with no erors" deployment.log; then
echo "Deployment Test Complete with no errors"
exit 0
else
echo "Deployment Test Failed"
exit 1
fi