Skip to content

Commit a2db3c3

Browse files
authored
create deploy.yml
1 parent 24131d5 commit a2db3c3

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Pull, NPM Install, Restart Service and Reload Nginx
13+
uses: appleboy/ssh-action@master
14+
with:
15+
host: ${{ secrets.HOST }}
16+
username: ${{ secrets.USERNAME }}
17+
password: ${{ secrets.PASSWORD }}
18+
port: ${{ secrets.PORT }}
19+
script: |
20+
export NVM_DIR="$HOME/.nvm"
21+
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
22+
23+
cd /var/www/rent
24+
git pull
25+
npm ci
26+
npm run build
27+
28+
echo ${{ secrets.PASSWORD }} | sudo -S systemctl stop rent.service
29+
echo ${{ secrets.PASSWORD }} | sudo -S systemctl start rent.service
30+
echo ${{ secrets.PASSWORD }} | sudo -S systemctl reload nginx

0 commit comments

Comments
 (0)