Skip to content

Commit

Permalink
Docs: create deploy.yml file for GitHub Actions workflow automation
Browse files Browse the repository at this point in the history
  • Loading branch information
oneeee822 authored Jul 28, 2024
1 parent e0f4055 commit f3b1bda
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Deploy to PythonAnywhere

on:
push:
branches:
- develop

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Copy files via SCP
uses: appleboy/scp-action@v0.1.2
with:
host: ssh.pythonanywhere.com
username: eehnow
key: ${{ secrets.PYTHONANYWHERE_SSH_KEY }}
source: "."
target: "/home/eehnow/econet"
rm: true

- name: SSH and run deploy commands
uses: appleboy/ssh-action@v0.1.4
with:
host: ssh.pythonanywhere.com
username: eehnow
key: ${{ secrets.PYTHONANYWHERE_SSH_KEY }}
script: |
source /home/eehnow/econet/bin/activate
cd /home/eehnow/econet
git pull origin develop
pip install -r requirements.txt
python manage.py migrate
python manage.py collectstatic --noinput
touch /var/www/eehnow_pythonanywhere_com_wsgi.py

0 comments on commit f3b1bda

Please sign in to comment.