Merge pull request #61 from razzat008/main #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & deploy in VPS | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Deploy using ssh | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
key: ${{ secrets.PRIVATE_KEY }} | ||
port: 22 | ||
script: | | ||
cd ~/website | ||
git pull origin main | ||
yarn install | ||
yarn build | ||
if [ $? -ne 0 ]; then | ||
echo "Build failed" | ||
exit 1 | ||
fi | ||
pm2 restart . | ||
2 changes: 1 addition & 1 deletion | ||