Skip to content

Add workflow_dispatch #2

Add workflow_dispatch

Add workflow_dispatch #2

Workflow file for this run

# Github action for connecting to digitalocean server and run the deploy script
name: Deploy
on: workflow_dispatch
on:

Check failure on line 4 in .github/workflows/deploy.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/deploy.yml

Invalid workflow file

You have an error in your yaml syntax on line 4
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Connect to DigitalOcean Droplet
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
kill -9 $(cat ~/pc-components/backend/server_pid.txt)
kill -9 $(cat ~/pc-components/frontend/server_pid.txt)
cd ~
rm -rf ./pc-components
git clone https://github.com/Pansysk75/pc-components.git
cd ~/pc-components/backend
source venv/bin/activate
pip install -r requirements.txt
python run.py &> server_log.txt &
echo $! > server_pid.txt
cd ~/pc-components/frontend
python -m http.server 80 &> server_log.txt &
echo $! > server_pid.txt