Merge branch 'main' of https://github.com/ItzyBitzySpider/pawnpawnpwn #30
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: Backend CI/CD | |
on: | |
push: | |
branches: [ "main" ] | |
paths: | |
- backend/** | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to Digital Ocean droplet via SSH action | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.SSH_USERNAME }} | |
key: ${{ secrets.SSH_KEY }} | |
script: | | |
ls | |
cd /home/hnr/pawnpawnpwn | |
# Pull from git repo | |
git checkout main || true # Force return true so exit code is not 1 | |
git pull | |
# Backend CD | |
cd backend | |
export PATH="$PATH:/home/hnr/.nvm/versions/node/v20.10.0/bin" | |
killall node || true # Force return true so exit code is not 1 | |
yarn install | |
nohup yarn start > nodemon.out 2> nodemon.err < /dev/null & | |