remove console logs #25
This file contains hidden or 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: Build and Deploy Code | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
Build: | |
environment: | |
name: prod | |
env: | |
DATABASE_HOSTNAME: ${{secrets.DB_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' | |
Deploy: | |
environment: | |
name: prod | |
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 | |
cd backtestApp | |
source venv/bin/activate | |
pip install -r requirements.txt | |
cd backtestApp/src/backend | |
python manage.py migrate | |
python manage.py collectstatic --noinput | |
sudo -S systemctl restart backtestAppFrontEnd.service | |
sudo -S systemctl restart backtestApp.service | |