Skip to content

Commit

Permalink
Merge pull request #211 from boostcampwm-2021/develop
Browse files Browse the repository at this point in the history
[develop] merge to main
  • Loading branch information
ChanHoHan authored Dec 9, 2021
2 parents 3663877 + 74af35f commit 579c5f3
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CD

# Controls when the workflow will run
on:
push:
branches: [ develop ]
pull_request:
types: [closed]
branches: [ develop ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
#if: github.event.pull_request.merged

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Runs a single command using the runners shell
- name: Run a one-line script
run: echo Hello, world!

- name: ncloud CD
uses: appleboy/ssh-action@master
with:
key: ${{secrets.SSH_PRIVATE_KEY}}
host: ${{secrets.REMOTE_HOST}}
username: ${{secrets.REMOTE_USERNAME}}
port: ${{secrets.REMOTE_PORT_NUMBER}}
script: sh /var/www/app/web24-boostris/deploy.sh
10 changes: 10 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cd /var/www/app/web24-boostris
git fetch --all
git reset --hard origin/main
cd /var/www/app/web24-boostris/front-end
npm ci
npm run build
rm -rf /var/www/html/*
cp -r /var/www/app/web24-boostris/front-end/build/* /var/www/html
cd /var/www/app/web24-boostris/back-end/api-server
pm2 reload ts-node

0 comments on commit 579c5f3

Please sign in to comment.