add post #8
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 to production | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy with pm2 | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.SSH_KEY }} | |
script: | | |
rm -rf /var/www/codante-changelog | |
git clone --depth 1 git@github.com:codante-io/changelog.git /var/www/codante-changelog | |
cd /var/www/codante-changelog | |
npm install | |
npm run build | |
pm2 restart codante-changelog |