From 77cd53091f0cf99de105098c0664a2efc13f4e44 Mon Sep 17 00:00:00 2001 From: Bobby Date: Mon, 15 May 2023 09:02:54 -0400 Subject: Update workflow with deployment commands --- .github/workflows/main.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b9e73c52..fa73ab00 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,4 +13,25 @@ jobs: username: ${{ secrets.USERNAME }} key: ${{ secrets.KEY_ED25519 }} port: ${{ secrets.PORT }} - script: sh /home/ubuntu/deploy.sh \ No newline at end of file + script: | + cd /home/ubuntu/thatcomputerscientist/ + git pull origin main --recurse-submodules + rm -rf .env + cp /home/ubuntu/.env . + pip3 install -r requirements.txt + python3 manage.py makemigrations + python3 manage.py migrate + python3 manage.py collectstatic --noinput + kill $(ps aux | grep 'daphne -b 0.0.0.0 -p 8000 thatcomputerscientist.asgi:application' | grep -v grep | awk '{print $2}') + nohup daphne -b 0.0.0.0 -p 8000 thatcomputerscientist.asgi:application > /dev/null 2>&1 & + echo "Deployed Successfully" + echo "Taking Screenshot" + echo "Sleeping..." + sleep 5 + echo Curl Running... + curl -k -L --output siteshot.png http://localhost:8000/ignis/screenshot + rm siteshot.png + echo "Screenshot Saved..." + ls thatcomputerscientist/ + echo "Done" + \ No newline at end of file -- cgit v1.2.3