Skip to content

Commit

Permalink
Changed CI
Browse files Browse the repository at this point in the history
  • Loading branch information
alouradou committed Mar 25, 2024
1 parent 850e7c0 commit 01b9792
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions .github/workflows/auto-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,6 @@ jobs:
source serenadoit/bin/activate
pip install -r requirements.txt
- name: Run database initialization
run: |
cd /home/oignon/node/static/uploads/
python db_manager.py
- name: Run tests
run: |
cd tests
python -m unittest discover -s . -p 'test_*.py'
deploy:
name: Deploy to Server
runs-on: ubuntu-latest
Expand All @@ -57,6 +46,29 @@ jobs:
rm -rf ~/node/static/styles/ ~/node/static/scripts/ ~/node/static/images/
cp -r ./static ~/node/
- name: Initialize database
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SERVER_SSH_KEY }}
port: ${{ secrets.SERVER_PORT }}
script: |
cd ~/node/static/uploads/
python db_manager.py
- name: Test python code
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SERVER_SSH_KEY }}
port: ${{ secrets.SERVER_PORT }}
script: |
cd serenadoit
source serenadoit/bin/activate
python -m unittest discover -s tests -p 'test_*.py'
- name: Install dependencies and restart server
uses: appleboy/ssh-action@master
with:
Expand Down

0 comments on commit 01b9792

Please sign in to comment.