Skip to content

Commit

Permalink
feat: add cd
Browse files Browse the repository at this point in the history
  • Loading branch information
Angga Maulana authored and Angga Maulana committed Mar 18, 2023
1 parent 1aec061 commit d292e68
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 3 deletions.
2 changes: 0 additions & 2 deletions .env.example

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Deploy to Ubuntu

on:
push:
branches:
- dev
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Deploy to server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
script: |
cd ~/multilevel/multilevel-frontend-dev
git pull
npm run build:only
npm run build
pm2 reload mlm_dev
24 changes: 24 additions & 0 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Deploy to Ubuntu

on:
push:
branches:
- staging
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Deploy to server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
script: |
cd ~/multilevel/multilevel-frontend-staging
git pull
npm run build:only
npm run build
pm2 reload mlm_staging
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
- uses: actions/checkout@v2
- name: Deploy to server
uses: appleboy/ssh-action@master
if: ${{ github.ref == 'refs/heads/master' }}
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
"yup": "^1.0.1"
},
"scripts": {
"start": "NODE_ENV=production node server.js",
"start": "NODE_ENV=production NODE_PORT=4000 node server.js",
"start_staging": "NODE_ENV=production NODE_PORT=4001 node server.js",
"start_dev": "NODE_ENV=production NODE_PORT=4002 node server.js",
"build": "next build",
"export": "next export",
"dev": "next dev",
Expand Down

0 comments on commit d292e68

Please sign in to comment.