Skip to content

Update deploy.yml

Update deploy.yml #16

Workflow file for this run

name: Deploy to VPS
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Copy repository contents via scp
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
source: "."
target: "~/core"
- name: Executing remote commands
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
cd ~/core
touch .env
echo -e "\n${{secrets.MONGO_URI}}" >> .env
echo -e "${{secrets.PORT}}" >> .env
export NVM_DIR=~/.nvm
source ~/.nvm/nvm.sh
yarn && yarn build
pm2 restart api