Skip to content

Update deploy.yml

Update deploy.yml #2

Workflow file for this run

name: CI
on:
push:
branches: ["develop"]
pull_request:
branches: ["develop"]
env:
SECRET_KEY: ${{ secrets.SECRET_KEY }}
POSTGRES_DB: ${{ secrets.DB_USERNAME }}
POSTGRES_USER: ${{ secrets.DB_DATABASE }}
POSTGRES_PASSWORD: ${{ secrets.DB_USER_PASSWORD }}
DEVELOPER_KEY: ${{ secrets.DB_ROOT_PASSWORD }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
jobs:
backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Install pipenv
run: python -m pip install pipenv
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
restore-keys: ${{ runner.os }}-pipenv-
- name: Install dependencies
working-directory: backend
run: pipenv install
- name: Run tests
working-directory: backend
run: |
pipenv run python manage.py makemigrations
pipenv run python manage.py migrate
pipenv run python manage.py test
frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache frontend packages
uses: actions/cache@v3
with:
path: frontend/node_modules
key: ${{ runner.os }}-frontend-${{ hashFiles('frontend/package-lock.json') }}
restore-keys: ${{ runner.os }}-frontend-
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install packages
working-directory: frontend
run: npm ci