Skip to content

Commit

Permalink
chore(ci): add github action
Browse files Browse the repository at this point in the history
  • Loading branch information
paulleflon committed Sep 19, 2024
1 parent f5aa1fe commit 7361a17
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Deploy

on: [push]

jobs:
deploy:
if: github.ref == 'refs/heads/master'
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: Run server update script
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_IP }}
port: ${{ secrets.SERVER_PORT }}
username: ${{ secrets.SERVER_USER }}
password: ${{ secrets.SERVER_PASSWORD }}
script: cd ${{ secrets.SERVER_PROJECT_PATH }} && yarn update
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"private": false,
"scripts": {
"start": "node src/app.js",
"dev": "nodemon -e js -L"
"dev": "nodemon -e js -L",
"update": "git reset --hard && git pull && pm2 restart \"Retweet\""
},
"dependencies": {
"bcrypt": "^5.0.1",
Expand All @@ -29,4 +30,4 @@
"nodemon": "^2.0.15"
},
"packageManager": "yarn@4.4.1+sha512.f825273d0689cc9ead3259c14998037662f1dcd06912637b21a450e8da7cfeb4b1965bbee73d16927baa1201054126bc385c6f43ff4aa705c8631d26e12460f1"
}
}

0 comments on commit 7361a17

Please sign in to comment.