Skip to content

Commit

Permalink
setting,test : CI/CD 테스트
Browse files Browse the repository at this point in the history
  • Loading branch information
Ariling committed Feb 7, 2024
1 parent 3b55645 commit 3baccc8
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Deploy
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout source code.
uses: actions/checkout@v2
- name: Check Node v
run: node -v
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Build
run: yarn build
env:
NEXT_PUBLIC_SERVER_URL: ${{ secrets.NEXT_PUBLIC_SERVER_URL }}
- name: zip create
run: zip -qq -r ./build.zip .
shell: bash
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Upload to S3
run: |
aws s3 cp --region ap-northeast-2 ./build.zip s3://floud-bucket/build.zip
- name: Deploy
run: aws deploy create-deployment
--application-name flouD-codeDeploy
--deployment-config-name CodeDeployDefault.AllAtOnce
--deployment-group-name flouD-codeDeploy-group
--s3-location bucket=floud-bucket,bundleType=zip,key=build.zip
16 changes: 16 additions & 0 deletions appspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 0.0
os: linux
files:
- source: /
destination: /home/ubuntu/deploy
overwrite: yes
permissions:
- object: /home/ubuntu/deploy
owner: root
group: root
mode: 755
hooks:
AfterInstall:
- location: deploy.sh
timeout: 1000
runas: root
7 changes: 7 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
REPOSITORY=/home/ubuntu/deploy

cd $REPOSITORY

sudo npm install next

sudo pm2 reload all

0 comments on commit 3baccc8

Please sign in to comment.