diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
new file mode 100644
index 0000000..9abf4ee
--- /dev/null
+++ b/.github/workflows/main.yml
@@ -0,0 +1,75 @@
+name: Continuous Deploy with GitHub Actions + S3 & EC2
+
+on:
+ push:
+ branches:
+ - feature/*
+ pull_request:
+ branches:
+ - main
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout current commit (${{github.sha}})
+ uses: actions/checkout@v3
+
+ - name: Set up Node
+ uses: actions/setup-node@v3
+ with:
+ node-version: 20.x
+
+ - name: Cache Dependencies
+ uses: actions/cache@v3
+ id: cache
+ with:
+ # node_modules 폴더 검사
+ path: node_modules
+ # 아래 키값으로 cache가 되있는지 확인
+ key: npm-packages-${{ hashFiles('**/package-lock.json') }}\
+
+ - name: Generate Environment Variables File
+ env:
+ SECRET_KEY: ${{ secrets.SECRET_KEY }}
+ MONGODB_URL: ${{ secrets.MONGODB_URL }}
+ MY_AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
+ MY_AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
+ AWS_IMAGE_BUCKET: ${{ secrets.AWS_IMAGE_BUCKET }}
+ DEFAULT_PROFILE_IMG_URL: ${{ secrets.DEFAULT_PROFILE_IMG_URL }}
+ DEFAULT_POST_IMG_URL: ${{ secrets.DEFAULT_POST_IMG_URL }}
+
+ run: |
+ echo "SECRET_KEY: $SECRET_KEY" >> .env
+ echo "MONGODB_URL=$MONGODB_URL" >> .env
+ echo "MY_AWS_ACCESS_KEY=$MY_AWS_ACCESS_KEY" >> .env
+ echo "MY_AWS_SECRET_KEY=$MY_AWS_SECRET_KEY" >> .env
+ echo "DEFAULT_PROFILE_IMG_URL=$DEFAULT_PROFILE_IMG_URL" >> .env
+ echo "NEXT_PUBLIC_DEFAULT_POST_IMG=$DEFAULT_POST_IMG_URL" >> .env
+
+ - name: Install Dependencies
+ if: steps.cache.outputs.cache-hit != 'true'
+ run: npm ci
+
+ - name: Build Next App
+ run: |
+ npm run build
+ env:
+ CI: false
+
+ - name: Zip Build File
+ run: zip -qq -r ./ONEHOUR.zip . -x "node_modules/*"
+ 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 ./ONEHOUR.zip s3://${{ secrets.AWS_S3_BUCKET }}/ONEHOUR.zip
+
+ - name: Code Deploy
+ run: aws deploy create-deployment --application-name ${{ secrets.CODEDEPLOY_APPLICATION }} --deployment-config-name CodeDeployDefault.AllAtOnce --deployment-group-name ONEHOUR --s3-location bucket=${{ secrets.AWS_S3_BUCKET }},bundleType=zip,key=ONEHOUR.zip
diff --git a/appspec.yml b/appspec.yml
new file mode 100644
index 0000000..ad31454
--- /dev/null
+++ b/appspec.yml
@@ -0,0 +1,18 @@
+version: 0.0
+os: linux
+
+files:
+ - source: /
+ destination: /home/ubuntu/deploy
+ overwrite: yes
+file_exists_behavior: OVERWRITE
+permissions:
+ - object: /home/ubuntu/deploy
+ owner: root
+ group: root
+ mode: 755
+hooks:
+ AfterInstall:
+ - location: ./deploy.sh
+ timeout: 1000
+ runas: root
diff --git a/components/navigator/Navigator.tsx b/components/navigator/Navigator.tsx
index 3fb5405..188cae0 100644
--- a/components/navigator/Navigator.tsx
+++ b/components/navigator/Navigator.tsx
@@ -84,8 +84,7 @@ const Navigator = (props: { children: ReactNode }) => {
onClick={() => {
router.push("/dashboard");
}}
- className={styles.logoWrapper}
- >
+ className={styles.logoWrapper}>
{pathname?.includes("challenges") ? "LET’S GO !" : "START CHALLENGE"}