File tree Expand file tree Collapse file tree 3 files changed +49
-1
lines changed Expand file tree Collapse file tree 3 files changed +49
-1
lines changed Original file line number Diff line number Diff line change 1+ name : Deploy latest to server
2+ on :
3+ push :
4+ branches : [main]
5+
6+ jobs :
7+ deploy :
8+ runs-on : ubuntu-latest
9+ steps :
10+ - name : Deploy NodeJS app
11+ uses : appleboy/ssh-action@v0.1.2
12+ with :
13+ host : ${{secrets.SSH_HOST}} # IP address of the server you wish to ssh into
14+ key : ${{secrets.SSH_KEY}} # Private or public key of the server
15+ username : ${{ secrets.SSH_USERNAME }} # User of the server you want to ssh into
16+
17+ script : |
18+ set -e
19+
20+ mkdir -p $HOME/webapps
21+ git clone https://github.com/cs01/python-packaging-tools $HOME/webapps/python-packaging-tools || true
22+ cd $HOME/webapps/python-packaging-tools
23+ git reset --hard
24+ cd frontend
25+ yarn
26+ yarn build
27+
28+ # reload and restart systemd service
29+ sudo cp scripts/python-packaging-tools.service /etc/systemd/system/python-packaging-tools.service
30+ sudo systemctl daemon-reload
31+ sudo systemctl enable python-packaging-tools.service
32+ sudo systemctl restart python-packaging-tools
Original file line number Diff line number Diff line change 11.env
22data.json
33makefile
4- * .service
54node_modules
65frontend /src /App.css
Original file line number Diff line number Diff line change 1+ # https://www.freedesktop.org/software/systemd/man/systemd.service.html
2+ [Unit]
3+ Description =
4+ After =network.target
5+
6+ [Service]
7+ User =csmith
8+ Group =www-data
9+ WorkingDirectory =$HOME/webapps/python-packaging-tools/backend
10+ PermissionsStartOnly =true
11+ ExecStart =/bin/bash $HOME/webapps/python-packaging-tools/backend/start.sh
12+ ExecStop =
13+ Restart =on-failure
14+ RestartSec =5s
15+
16+ [Install]
17+ WantedBy =multi-user.target
You can’t perform that action at this time.
0 commit comments