-
Notifications
You must be signed in to change notification settings - Fork 7
๐ชต 3. ์ธํ๋ผ ์ค์ต(3) : ๋์ปค ์์ด ๋ฐฐํฌํ๊ธฐ CI CD
ssum1ra edited this page Dec 5, 2024
·
1 revision
name: Whiteboard CI/CD
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
# ์บ์ ์ค์ (npm ๊ธฐ์ค)
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
**/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
# ํ๋ก ํธ์๋ ๋น๋ ๋ฐ ๋ฐฐํฌ
- name: Install & Build Frontend
working-directory: ./client
env:
VITE_SOCKET_URL: ${{ secrets.VITE_SOCKET_URL }}
run: |
npm ci
npm run build
# Object Storage ์
๋ก๋
- name: Deploy to Object Storage
env:
AWS_ACCESS_KEY_ID: ${{ secrets.NCP_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.NCP_SECRET_KEY }}
run: |
# S3 ์
๋ก๋
aws s3 sync ./client/dist s3://test-web30 \
--endpoint-url https://kr.object.ncloudstorage.com \
--region kr-standard
# ๋ฐฑ์๋ ๋ฐฐํฌ
- name: Deploy Backend
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ncloud
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd ~/whiteboard/server
git pull
npm ci
npm run build
# ์๋ฒ์ ํ๊ฒฝ๋ณ์ ํ์ผ ์์ฑ
cat << EOF > .env
# DATABASE_URL=${{ secrets.DATABASE_URL }}
EOF
# PM2 ์ฌ์์
pm2 restart whiteboard-server || pm2 start dist/main.js --name "whiteboard-server"
- npm ๊ธฐ์ค
- Actions ํญ์์ ๋ก๊ทธ ํ์ธ ๊ฐ๋ฅ
- NCP Object Storage๋ AWS S3 CLI์ ํธํ๋๋๋ก ์ค๊ณ๋จ.
- Object Storage CLI
- name: Deploy to Object Storage
env:
AWS_ACCESS_KEY_ID: ${{ secrets.NCP_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.NCP_SECRET_KEY }}
run: |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install # ์ด๋ฏธ ์ค์น๋์ด ์์ผ๋ฏ๋ก ์ญ์ ํด์ผ ํจ.
aws s3 sync ./client/dist s3://test-web30 \
--endpoint-url https://kr.object.ncloudstorage.com \
--region kr-standard
ubuntu-latest์ ๊ธฐ๋ณธ ์ค์น๋ ๊ฒ๋ค
- โ AWS CLI
- โ curl
- โ git
- โ npm
- โ python
-
ํ๋ก ํธ์๋ (env: ์ฌ์ฉ ๊ฐ๋ฅ)
- ๋น๋ ์์ ์๋ง ํ๊ฒฝ๋ณ์ ํ์
- ๋น๋ ํ์๋ ์ ์ ํ์ผ๋ก ๋ณํ
-
๋ฐฑ์๋ (ํ์ผ ํ์)
- ๋ฐํ์์ ์ง์์ ์ผ๋ก ํ๊ฒฝ๋ณ์ ์ฐธ์กฐ
- ์๋ฒ ๋์ ์ค์๋ ํ๊ฒฝ๋ณ์ ํ์
- ์ฆ, GitHub Actions ์คํ์ด ์ข ๋ฃ๋๋ฉด ํ๊ฒฝ ๋ณ์๊ฐ ์ญ์ ๋๋ฏ๋ก, ์๋ฒ์์๋ ๋ ๋ฆฝ์ ์ธ ํ๊ฒฝ ๋ณ์ ํ์ผ์ด ํ์ํ๋ค.
- 1. ๊ฐ๋ฐ ํ๊ฒฝ ์ธํ ๋ฐ ํ๋ก์ ํธ ๋ฌธ์ํ
- 2. ์ค์๊ฐ ํต์
- 3. ์ธํ๋ผ ๋ฐ CI/CD
- 4. ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์์ด Canvas ๊ตฌํํ๊ธฐ
- 5. ์บ๋ฒ์ค ๋๊ธฐํ๋ฅผ ์ํ ์์ CRDT ๊ตฌํ๊ธฐ
-
6. ์ปดํฌ๋ํธ ํจํด๋ถํฐ ์น์์ผ๊น์ง, ํจ์จ์ ์ธ FE ์ค๊ณ
- ์ข์ ์ปดํฌ๋ํธ๋ ๋ฌด์์ธ๊ฐ? + Headless Pattern
- ํจ์จ์ ์ธ UI ์ปดํฌ๋ํธ ์คํ์ผ๋ง: Tailwind CSS + cn.ts
- Tailwind CSS๋ก ๋์์ธ ์์คํ ๋ฐ UI ์ปดํฌ๋ํธ ์ธํ
- ์น์์ผ ํด๋ผ์ด์ธํธ ๊ตฌํ๊ธฐ: React ํ๊ฒฝ์์ ํจ์จ์ ์ธ ์น์์ผ ์ํคํ ์ฒ
- ์น์์ผ ํด๋ผ์ด์ธํธ ์ฝ๋ ๋ถ์ ๋ฐ ๊ณต์
- 7. ํธ๋ฌ๋ธ ์ํ ๋ฐ ์ฑ๋ฅ/UX ๊ฐ์
- 1์ฃผ์ฐจ ๊ธฐ์ ๊ณต์
- 2์ฃผ์ฐจ ๋ฐ๋ชจ ๋ฐ์ด
- 3์ฃผ์ฐจ ๋ฐ๋ชจ ๋ฐ์ด
- 4์ฃผ์ฐจ ๋ฐ๋ชจ ๋ฐ์ด
- 5์ฃผ์ฐจ ๋ฐ๋ชจ ๋ฐ์ด
- WEEK 06 ์ฃผ๊ฐ ๊ณํ
- WEEK 06 ๋ฐ์ผ๋ฆฌ ์คํฌ๋ผ
- WEEK 06 ์ฃผ๊ฐ ํ๊ณ