-
Notifications
You must be signed in to change notification settings - Fork 8
52 lines (47 loc) · 1.38 KB
/
gpio.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Manual GPIO Deploy
on:
#push:
# branches:
# - testgpio
workflow_dispatch:
jobs:
GPIO:
name: Manual GPIO Deploy
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: sshagent
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.GPIO_SSHKEY }}
- name: deploy
run: |
branch="${GITHUB_REF#refs/heads/}"
echo "The branched that was pushed is $branch"
mkdir -p ~/.ssh
chmod 700 ~/.ssh
echo "github.planetfarms.io ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBDtrYtt44iGGRUDlL9aC3S/Xb40TuPx18NxngzjkSGrtq5tkPKQbOAZmEyVOONEFwHqIRQUgCbjQGwYtunbXaco=" > ~/.ssh/known_hosts
ssh [email protected] <<EOF
cd /srv/planetfarms/
pwd
git branch
git pull
git checkout $branch
git branch
git pull
screen -ls
killall node
sleep 1
#screen -X -S api kill
#screen -X -S react kill
screen -ls
npm i
cd api/
npm i
npx sequelize-cli db:migrate
cd ..
screen -dmS react bash -c 'cd /srv/planetfarms; npm start'
screen -dmS api bash -c 'cd /srv/planetfarms/api; npm start'
screen -ls
EOF