Separate endpoints for comments handling #116
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Django CI/CD | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: [3.8, 3.9] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Dependencies | |
run: | | |
cd backend | |
python -m pip install --upgrade pip | |
pip install -r requirements_workflow.txt | |
- name: Run Tests | |
run: | | |
cd backend | |
echo "Running tests..." | |
deploy: | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- uses: actions/checkout@v3 | |
# Backend Tests and Deployment | |
- name: Test Backend | |
run: | | |
cd backend | |
echo "Running backend tests..." | |
- name: Deploy Backend | |
if: github.ref == 'refs/heads/main' | |
env: | |
deploy_url: ${{ secrets.BACKEND_RENDER_DEPLOY_HOOK_URL }} | |
run: | | |
curl "$deploy_url" | |
# Frontend Tests and Deployment | |
- name: Test Frontend | |
run: | | |
cd frontend | |
echo "Running frontend tests..." | |
- name: Deploy Frontend | |
if: github.ref == 'refs/heads/main' | |
env: | |
deploy_url: ${{ secrets.FRONTEND_RENDER_DEPLOY_HOOK_URL }} | |
run: | | |
curl "$deploy_url" |