Skip to content

Add django migration #10

Add django migration

Add django migration #10

Workflow file for this run

name: Build and Deploy Code
on:
push:
branches:
- main
jobs:
Build:
environment:
name: prod
env:
DATABASE_HOSTNAME: ${{secrets.DATABASE_HOSTNAME}}
DATABASE_PORT: ${{secrets.DATABASE_PORT}}
DATABASE_PASSWORD: ${{secrets.DATABASE_PASSWORD}}
DATABASE_NAME: ${{secrets.DATABASE_NAME}}
DATABASE_USERNAME: ${{secrets.DATABASE_USERNAME}}
SECRET_KEY: ${{secrets.SECRET_KEY}}
runs-on: ubuntu-latest
steps:
- name: Pulling git repo
uses: actions/checkout@v2
- name: Install Python 3.10
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Update pip
run: python -m pip install --upgrade pip
- name: Install dependencies
run: pip install -r requirements.txt
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install Node.js dependencies
run: |
cd frontend
npm install
- name: Apply Django Migrations
run: |
cd backend
python manage.py migrate
# Deploy:
# runs-on: ubuntu-latest
# needs: [Build]
# steps:
# - name: executing remote ssh commands using password
# uses: appleboy/ssh-action@v1.0.3
# with:
# host: ${{ secrets.PROD_HOST }}
# username: ${{ secrets.PROD_USERNAME }}
# password: ${{ secrets.PROD_PWD }}
# script: |
# cd backtestApp/src
# git pull
# echo ${{ secrets.SUDO_PWD }} | sudo -S systemctl restart backtestAppFrontEnd
# echo ${{ secrets.SUDO_PWD }} | sudo -S systemctl restart backtestApp