This file contains hidden or 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: TinyPen production deploy on push to main. | |
| on: | |
| push: | |
| branches: main | |
| jobs: | |
| deploy: | |
| strategy: | |
| matrix: | |
| node-version: | |
| - 22 | |
| machines: | |
| - vlcdhprdp01 | |
| runs-on: ${{ matrix.machines }} | |
| steps: | |
| - uses: actions/checkout@master | |
| - name: Deploy the app on the server | |
| run: | | |
| if [[ ! -e /srv/node/logs/tinypen.txt ]]; then | |
| mkdir -p /srv/node/logs | |
| touch /srv/node/logs/tinypen.txt | |
| fi | |
| echo $USER | |
| echo $PATH | |
| pwd | |
| which pm2 | |
| cd /srv/node/tinyPen/ | |
| pm2 stop tinyPen | |
| git stash | |
| git checkout main | |
| git pull | |
| npm install | |
| pm2 start -i max bin/tinyPen.js |