Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
hasianamin committed May 30, 2023
0 parents commit a280d30
Show file tree
Hide file tree
Showing 28 changed files with 36,067 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Deploy

on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Build Project
run: |
npm install
npm run build
- name: Deploy to Linode
uses: appleboy/scp-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
source: './projects/client/build,./projects/client/package.json,./projects/server/src,./projects/server/package.json,./deploy.config.js,./package*.json'
target: '${{ secrets.SSH_FOLDER }}'
- name: Run App
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
script: |
cd ${{ secrets.SSH_FOLDER }}
npm install
pm2 start deploy.config.js
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
13 changes: 13 additions & 0 deletions deploy.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
apps: [
{
name: "JCWD-2000-01", // Format JCWD-{batchcode}-{groupnumber}
script: "./projects/server/src/index.js",
env: {
NODE_ENV: "production",
PORT: 8000,
},
time: true,
},
],
};
6 changes: 6 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"useWorkspaces": true,
"version": "0.1.0",
"npmClient": "npm"
}

0 comments on commit a280d30

Please sign in to comment.