Change application to run on subpath (#207) #71
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 Queue | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install SSH Key | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{secrets.SSH_PRIVATE_KEY}} | |
known_hosts: 'placeholder' | |
- name: Adding Known Hosts | |
run: ssh-keyscan -H ${{ secrets.SSH_HOST_IP }} >> ~/.ssh/known_hosts | |
- name: Move to machine with rsync | |
run: rsync -avz /home/runner/work/q-prime/q-prime ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST_IP }}:/home/${{ secrets.SSH_USER }}/q-live/ | |
- name: Deploy to production and restart | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.SSH_HOST_IP }} | |
username: ${{ secrets.SSH_USER }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
script: | | |
cd /home/${{ secrets.SSH_USER }}/q-live | |
export NVM_DIR=~/.nvm | |
source ~/.nvm/nvm.sh | |
fuser -k 8000/tcp | |
tmux kill-session -t queue | |
cd $HOME/q-live/q-prime/client && npm install && npm run build | |
cd $HOME/q-live/q-prime/server | |
tmux new-session -d -s queue 'npm install && npm start' | |
echo `tmux attach` | |