From 1230725848670317fdb53c8bb02071b8fed4f013 Mon Sep 17 00:00:00 2001 From: Ruchir28 Date: Sat, 10 Feb 2024 15:42:23 +0530 Subject: [PATCH] Setup Github Actions --- .github/workflows/deploy.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..36f7dea --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,25 @@ +name: Deploy Application + +on: + push: + branches: + - main # or any branch you want to deploy from + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Deploy to remove server + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.REMOTE_HOST }} + username: ${{ secrets.REMOTE_USER }} + key: ${{ secrets.SSH_PRIVATE_KEY }} + script: | + cd /workplace/Questionnaire + git pull origin main + npm install + npm run build:frontend + npm run build:backend + cd backend + pm2 start dist/index.js \ No newline at end of file