From 787fc197bec9aea229391afea962b801b3a05a6f Mon Sep 17 00:00:00 2001 From: bbearcookie Date: Sun, 29 Oct 2023 16:14:18 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20appspec.yml=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/express-deploy.yml | 10 ++++------ packages/slack/appspec.yml | 18 ++++++++++++++++++ packages/slack/scripts/after-deploy.sh | 8 ++++++++ 3 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 packages/slack/appspec.yml create mode 100644 packages/slack/scripts/after-deploy.sh diff --git a/.github/workflows/express-deploy.yml b/.github/workflows/express-deploy.yml index 8ddd41f..0cee05f 100644 --- a/.github/workflows/express-deploy.yml +++ b/.github/workflows/express-deploy.yml @@ -7,9 +7,9 @@ on: jobs: build: runs-on: ubuntu-latest - # defaults: - # run: - # working-directory: ./packages/slack/ + defaults: + run: + working-directory: ./packages/slack/ steps: - uses: actions/checkout@v3 @@ -19,7 +19,7 @@ jobs: node-version: 18.x - run: yarn - - run: yarn slack build + - run: yarn build - name: Setting .env run: | @@ -59,8 +59,6 @@ jobs: - name: Compress Files run: tar cvfz ./$GITHUB_SHA.gz ./packages/slack/dist - - run: ls -al - - name: Upload to S3 run: aws s3 cp --region ap-northeast-2 ./$GITHUB_SHA.gz s3://${{secrets.AWS_BACKEND_S3_BUCKET}}/deployment/$GITHUB_SHA.gz diff --git a/packages/slack/appspec.yml b/packages/slack/appspec.yml new file mode 100644 index 0000000..ef08deb --- /dev/null +++ b/packages/slack/appspec.yml @@ -0,0 +1,18 @@ +version: 0.0 +os: linux +files: + - source: / + destination: /home/ubuntu/build + overwrite: yes + +permissions: + - object: /home/ubuntu + pattern: '**' + owner: ubuntu + group: ubuntu + +hooks: + AfterInstall: + - location: scripts/after-deploy.sh + timeout: 300 + runas: ubuntu diff --git a/packages/slack/scripts/after-deploy.sh b/packages/slack/scripts/after-deploy.sh new file mode 100644 index 0000000..cd98e8b --- /dev/null +++ b/packages/slack/scripts/after-deploy.sh @@ -0,0 +1,8 @@ +#!/bin/bash +REPOSITORY=/home/ubuntu/build + +cd $REPOSITORY + +sudo yarn + +sudo pm2 start dist