install yarn and pm2 on CD #5
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: | |
- uses: actions/checkout@v2 | |
- name: Setup node and install dependencies | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 18.x | |
- run: npm install -g yarn pm2 | |
- run: yarn install | |
- name: Deploy using SSH | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.PRIVATE_KEY }} | |
port: 22 | |
script: | | |
npm install -g yarn pm2 | |
cd ~/codium-website | |
git pull | |
yarn install | |
yarn build | |
pm2 restart website |