-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
๐ฆ chore: Chromatic ์ค์น ๋ฐ CI/CD ์ํฌํ๋ก ์์ฑ (#7)
* ๐ฆ chore: Chromatic ์ค์น * ๐ฆ chore: PR์ Chromatic ๋ฐฐํฌ CI ์์ฑ * ๐ฆ chore: main์ push์ Chromatic ๋ฐฐํฌ CI ์ํฌํ๋ก ์์ฑ * ๐ fix: ์์กด์ฑ ์บ์ฑ path ์์ * ๐ฆ chore: ๋น๋ ํ ์คํธ job ์ด๋ฆ build๋ก ๋ณ๊ฒฝ * ๐ฆ chore: Vercel ๋ฐฐํฌ CI/CD ์ธํ (#10) * ๐ฆ chore: Pull Request์ Preview์ Vercel ์ถ๊ฐ * ๐ฆ chore: ์์๋ก preview ๋์ ๋ธ๋์น ๋ณ๊ฒฝ * ๐ฆ chore: preview ๋์ ๋ธ๋์น main์ผ๋ก ์์๋ณต๊ตฌ * ๐ฆ chore: main ๋ธ๋์น vercel deploy ์ํฌํ๋ก ์์ฑ * โ test: ์์๋ก deploy ๋์ ๋ธ๋์น ๋ณ๊ฒฝ * ๐ฆ chore: deploy ๋์ ๋ธ๋์น main์ผ๋ก ์์๋ณต๊ตฌ * ๐ deploy: Vercel ๋ฐฐํฌ ํ์ผ๋ก ๋ณ๊ฒฝ * โ test: preview ๋์ ์์ ๋ณ๊ฒฝ * โ test: sleep 60์ด๋ก ๋ณ๊ฒฝ (ํ ์คํธ) * โ test: sleep 30์ด๋ก ์์๋ณต๊ตฌ * ๐ฆ chore: Vercel SPA Fallback ์ค์ * ๐ฆ chore: preview ๋์ ๋ธ๋์น main์ผ๋ก ์์๋ณต๊ตฌ * ๐ deploy: ๋ฐฐํฌ * โ test: output ์ถ๋ ฅ ํ ์คํธ * โ test: vercel-output.txt ์์ฑ ํ ์ถ๋ ฅ * โ test: $GITHUB_OUTPUT ์ผ๋ก ์ง์ URL ๋ด๋ณด๋ด๊ธฐ * โ test: cat vercel-output.txt >> $GITHUB_OUTPUT * โ test: env.VERCEL_URL ๋ก ์๋ * โ test: $GITHUB_OUTPUT ๋ก ๋ณ๊ฒฝ * ๐ style: ์ํฌํ๋ก ์ฝ๋ ์ ๋ฆฌ
- Loading branch information
1 parent
e9c35ad
commit 01401e0
Showing
8 changed files
with
190 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Deploy | ||
|
||
env: | ||
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | ||
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | ||
|
||
on: | ||
push: | ||
branches: ['main'] | ||
|
||
jobs: | ||
chromatic: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Node.js ์ค์น | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
cache: 'npm' | ||
|
||
- name: ์์กด์ฑ ์บ์ฑ | ||
uses: actions/cache@v3 | ||
id: npm-cache | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
|
||
- name: ์์กด์ฑ ์ค์น | ||
if: steps.npm-cache.outputs.cache-hit != 'true' | ||
run: npm ci | ||
|
||
- name: Chromatic์ ๋ฐฐํฌ | ||
id: chromatic | ||
uses: chromaui/action@latest | ||
with: | ||
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
onlyChanged: true | ||
autoAcceptChanges: true | ||
|
||
vercel: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Vercel CLI ์ค์น | ||
run: npm install --global vercel@latest | ||
|
||
- name: Vercel ํ๊ฒฝ ๋ณ์ ๊ฐ์ ธ์ค๊ธฐ | ||
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} | ||
|
||
- name: Project Artifacts ๋น๋ํ๊ธฐ | ||
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} | ||
|
||
- name: Vercel์ Project Artifacts ๋ฐฐํฌํ๊ธฐ | ||
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
name: Preview | ||
|
||
env: | ||
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | ||
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | ||
|
||
on: | ||
pull_request: | ||
branches: ['main'] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Node.js ์ค์น | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
cache: 'npm' | ||
|
||
- name: ์์กด์ฑ ์บ์ฑ | ||
uses: actions/cache@v3 | ||
id: npm-cache | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
|
||
- name: ์์กด์ฑ ์ค์น | ||
if: steps.npm-cache.outputs.cache-hit != 'true' | ||
run: npm ci | ||
|
||
- name: React ๋น๋ | ||
run: npm run build --if-present | ||
|
||
chromatic-preview: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Node.js ์ค์น | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: ์์กด์ฑ ์บ์ฑ | ||
uses: actions/cache@v3 | ||
id: npm-cache | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
|
||
- name: ์์กด์ฑ ์ค์น | ||
if: steps.npm-cache.outputs.cache-hit != 'true' | ||
run: npm ci | ||
|
||
- name: Chromatic์ ๋ฐฐํฌ | ||
id: chromatic | ||
uses: chromaui/action@latest | ||
with: | ||
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
onlyChanged: true | ||
autoAcceptChanges: true | ||
outputs: | ||
storybook_url: ${{ steps.chromatic.outputs.storybookUrl }} | ||
|
||
vercel-preview: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Vercel CLI ์ค์น | ||
run: npm install --global vercel@latest | ||
|
||
- name: Vercel ํ๊ฒฝ ๋ณ์ ๊ฐ์ ธ์ค๊ธฐ | ||
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} | ||
|
||
- name: Project Artifacts ๋น๋ํ๊ธฐ | ||
run: vercel build --token=${{ secrets.VERCEL_TOKEN }} | ||
|
||
- name: Vercel์ Project Artifacts ๋ฐฐํฌํ๊ธฐ | ||
id: deploy | ||
run: | | ||
vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} > vercel-output.txt | ||
echo "preview_url=$(cat vercel-output.txt)" >> $GITHUB_OUTPUT | ||
outputs: | ||
vercel_url: ${{ steps.deploy.outputs.preview_url }} | ||
|
||
github-bot: | ||
runs-on: ubuntu-latest | ||
needs: [chromatic-preview, vercel-preview] | ||
steps: | ||
- name: PR ์ฝ๋ฉํธ๋ก Preview URL ๋จ๊ธฐ๊ธฐ | ||
uses: thollander/actions-comment-pull-request@v2 | ||
with: | ||
message: | | ||
๐ Storybook Preview ๋ณด๋ฌ๊ฐ๊ธฐ: ${{ needs.chromatic-preview.outputs.storybook_url }} | ||
๐ React Preview ๋ณด๋ฌ๊ฐ๊ธฐ: ${{ needs.vercel-preview.outputs.vercel_url }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,5 @@ dist-ssr | |
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
.vercel |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"routes": [ | ||
{ "handle": "filesystem" }, | ||
{ "src": "/(.*)", "dest": "/index.html" } | ||
] | ||
} |