chore: use pm2 commands directly instead of yarns to avoid no package… #2
Workflow file for this run
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: Epitome CI/CD | |
on: | |
push: | |
branches: | |
- master | |
- test/gh-actions | |
jobs: | |
deploy: | |
name: Deploy to Raspberry Pi 4 (self-hosted) 🦖 | |
runs-on: self-hosted | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Install npm dependencies with yarn | |
run: yarn | |
- name: Build epitome (/dist) | |
run: yarn run build | |
- name: Stop previous epitome pm2 process | |
run: pm2 delete epitome 2> /dev/null || true | |
- name: Prepare application directory | |
run: rm -rf ~/apps/epitome && mkdir ~/apps/epitome | |
- name: Move build contents to application directory | |
run: mv dist/* ~/apps/epitome | |
- name: Start new epitome pm2 process | |
run: cd ~/apps/epitome && pm2 start -f index.js --name epitome && pm2 save |