Merge pull request #1359 from DalgoT4D/snyk-upgrade-a6fa58d696fd6098b… #530
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 code | |
on: | |
push: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout main branch | |
uses: actions/checkout@v4 | |
- name: Create known_hosts file | |
run: | | |
mkdir -p ~/.ssh | |
touch ~/.ssh/known_hosts | |
- name: Add remote host key to known_hosts | |
run: ssh-keyscan ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts | |
- name: Connect to server & run commands | |
run: | | |
eval `ssh-agent -s` | |
ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}" | |
ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "source ~/.nvm/nvm.sh; cd /home/ddp/webapp; git pull; /home/ddp/.yarn/bin/yarn install; /home/ddp/.yarn/bin/yarn build; /home/ddp/.yarn/bin/pm2 restart ddp-webapp" |