Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
varsha1305nav committed Apr 4, 2024
1 parent 34a965b commit 56cff6c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/deploy_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,34 @@ jobs:
host: ${{ secrets.DEVSERVER }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SECRETKEY }}
command_timeout: 10m
command_timeout: 5m
script: |
cd xfluencer/influencer-marketplace
git pull
pgrep gunicorn | xargs kill -9
cd src/api/marketplace
source venv/bin/activate
pip3 install -r requirements.txt
pip3 install pyxfluencer-1.2.0-py3-none-any.whl
python3 manage.py migrate
python3 manage.py collectstatic -link --noinput
echo "Stopping previous processes..."
pgrep gunicorn | xargs kill -9
echo "Stopping redis service..."
sudo systemctl stop redis
echo "Starting redis service..."
sudo systemctl start redis
echo "Starting gunicorn..."
nohup sh -c 'gunicorn -w 4 marketplace.wsgi:application > gunicorn.out 2>&1' &
echo "Gunicorn started."
echo "Starting celery worker..."
nohup sh -c 'celery -A marketplace worker -l info > celery_worker.out 2>&1' &
echo "Celery worker started."
echo "Starting celery beat..."
nohup sh -c 'celery -A marketplace beat -l info > celery_beat.out 2>&1' &
echo "Celery beat started."
sudo systemctl restart nginx
sudo supervisorctl restart marketplace
echo "Restarted nginx"
- name: Remove Github Actions IP from security group
if: always()
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/deploy_prod_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Deploy API - Prod

on:
push:
branches: [ github-actions-prod ]
branches: [ release ]
jobs:
deploy:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -36,6 +36,7 @@ jobs:
pwd
git status
git pull
pgrep gunicorn | xargs kill -9
cd src/api/marketplace
source venv/bin/activate
pip3 install -r requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy_ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
host: ${{ secrets.DEVSERVER_UI }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SECRETKEY_UI }}
command_timeout: 10m
command_timeout: 5m
script: |
cd xfluencer/influencer-marketplace
git pull
Expand Down

0 comments on commit 56cff6c

Please sign in to comment.