Skip to content

Commit

Permalink
chore: appspec.yml 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
bbearcookie committed Oct 29, 2023
1 parent cc57b54 commit 787fc19
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/express-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -19,7 +19,7 @@ jobs:
node-version: 18.x

- run: yarn
- run: yarn slack build
- run: yarn build

- name: Setting .env
run: |
Expand Down Expand Up @@ -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

Expand Down
18 changes: 18 additions & 0 deletions packages/slack/appspec.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions packages/slack/scripts/after-deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
REPOSITORY=/home/ubuntu/build

cd $REPOSITORY

sudo yarn

sudo pm2 start dist

0 comments on commit 787fc19

Please sign in to comment.