Skip to content

Commit bb93d8f

Browse files
authored
Merge pull request #11 from foyzulkarim/chore/do-deployment-ready
Make deployment workflow ready
2 parents a00154d + d045ffe commit bb93d8f

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3+
4+
name: Deploy client
5+
6+
on:
7+
push:
8+
branches: ['main']
9+
workflow_dispatch:
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
matrix:
17+
node-version: [20.x]
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Deploy
22+
uses: appleboy/ssh-action@master
23+
with:
24+
host: ${{ secrets.SERVER_IP }}
25+
username: ${{ secrets.SERVER_USER }}
26+
key: ${{ secrets.SSH_KEY }}
27+
script: |
28+
cd /var/www/commitstreams-client
29+
export NVM_DIR=~/.nvm
30+
source ~/.nvm/nvm.sh
31+
32+
# verifies the right Node.js version is in the environment
33+
node -v # should print `v20.12.2`
34+
35+
# verifies the right NPM version is in the environment
36+
npm -v # should print `10.5.0`
37+
38+
source ~/.bashrc
39+
git pull origin main
40+
npm install
41+
npm run build

0 commit comments

Comments
 (0)