From cc2b18ea690ad39c2fb7bb00cf488e9a3b99cd99 Mon Sep 17 00:00:00 2001 From: chanho Date: Thu, 9 Dec 2021 09:50:09 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=9B=A0=20:=20deploy.yml=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yml | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..ec7cd49 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -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 From 74af35f13ef5e0ec69edc221ea18ef51a6bec93c Mon Sep 17 00:00:00 2001 From: chanho Date: Thu, 9 Dec 2021 09:51:09 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=9B=A0=20:=20deploy.sh=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 deploy.sh diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..3929956 --- /dev/null +++ b/deploy.sh @@ -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