Skip to content

Commit

Permalink
server need typescript to build
Browse files Browse the repository at this point in the history
  • Loading branch information
binsarjr committed Feb 20, 2024
1 parent c007bfa commit 8097e57
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 27 deletions.
32 changes: 7 additions & 25 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:
- closed


env:
GIT_SSH_COMMAND: ssh -i /home/ubuntu/binsar/.ssh/id_rsa_personal_asistant -o IdentitiesOnly=yes

jobs:
deploy:
Expand All @@ -26,41 +28,21 @@ jobs:
node-version: 17.x


- name: Install dependencies
run: npm install
- name: Build TypeScript
run: npm run build



- name: Upload to Server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
USERNAME: ${{ secrets.USERNAME }}
PORT: ${{ secrets.PORT }}
KEY: ${{ secrets.SSHKEY }}
source: "lib,dataset,asset,package.json,ecosystem.config.js"
target: ${{ secrets.SERVER_CWD }}


# - run: rm -rf lib
# - name: Remove Cached Lib folder
# uses: actions/cache@v2
# with:
# path: lib
# key: Build Cache

- name: Add SSH key to agent
- name: Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
USERNAME: ${{ secrets.USERNAME }}
PORT: ${{ secrets.PORT }}
KEY: ${{ secrets.SSHKEY }}
envs: GIT_SSH_COMMAND
script: |
cd ${{ secrets.SERVER_CWD }}
npm i --only-prod
yarn install --production
yarn build
GEMINI="${{ secrets.GEMINI_KEY }}" pm2 restart ecosystem.config.js --update-env
history -d $(history 2 | awk '{print $1}')
pm2 save
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
"@types/node": "^18.11.18",
"@types/node-schedule": "^2.1.0",
"mocha": "^10.2.0",
"ts-node": "^10.9.1",
"typescript": "^4.9.4"
"ts-node": "^10.9.1"
},
"dependencies": {
"typescript": "^4.9.4",
"@adiwajshing/keyed-db": "^0.2.4",
"@bochilteam/scraper": "4.2.3",
"@bochilteam/scraper-downloader": "^1.0.2",
Expand Down

0 comments on commit 8097e57

Please sign in to comment.