Merge branch 'master' of https://github.com/salimi-my/profolio #15
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: Deploy | |
# Trigger the workflow on push and | |
# pull request events on the master branch | |
on: | |
push: | |
branches: ['master'] | |
pull_request: | |
branches: ['master'] | |
# Authenticate to the the server via ssh | |
# and run our deployment script | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- uses: actions/checkout@v3 | |
- name: Deploy to Server | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
port: ${{ secrets.PORT }} | |
key: ${{ secrets.SSHKEY }} | |
script: | | |
cd /var/www/www.salimi.my | |
git pull origin main | |
git status | |
export PATH=/home/${{ secrets.SSH_USERNAME }}/.nvm/versions/node/20.9.0/bin:/usr/bin:/bin; | |
pnpm install | |
rm -rf .next | |
pnpm build | |
pm2 restart www.salimi.my |