Skip to content

Commit

Permalink
Merge pull request #6 from softeerbootcamp4th/feature/3-ssg
Browse files Browse the repository at this point in the history
[build] Static Site Generation 세팅 및 자동 배포 및 통합(CI/CD) 설정 (#3)
  • Loading branch information
darkdulgi authored Jul 23, 2024
2 parents 11cc5da + 43d93d0 commit 578fa27
Show file tree
Hide file tree
Showing 14 changed files with 902 additions and 18 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/check_lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: check lint
on:
pull_request:
branches:
- "main"
- "dev"
jobs:
check-lint:
runs-on: ubuntu-latest
steps:
- name: pull code to computer
uses: actions/checkout@v4
- name: install node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: check lint
run: |
npm install
npm run lint
echo "You're code is pretty!"
25 changes: 25 additions & 0 deletions .github/workflows/deploy_preview.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: deploy preview
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
on:
push:
branches:
- "dev"
jobs:
deploy-preview:
runs-on: ubuntu-latest
steps:
- name: pull code to computer
uses: actions/checkout@v4
- name: install node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: install vercel cli
run: npm install -g vercel
- name: deploy to vercel as preview
run: |
vercel pull --yes --token=${{ secrets.VERCEL_TOKEN }}
vercel build --token=${{ secrets.VERCEL_TOKEN }}
vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
25 changes: 25 additions & 0 deletions .github/workflows/deploy_production.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: deploy production
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
on:
push:
branches:
- "main"
jobs:
deploy-production:
runs-on: ubuntu-latest
steps:
- name: pull code to computer
uses: actions/checkout@v4
- name: install node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: install vercel cli
run: npm install -g vercel
- name: deploy to vercel as production
run: |
vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
vercel deploy --prod --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ lerna-debug.log*

node_modules
dist
dist-ssr
dist-ssg
*.local

# Editor directories and files
Expand All @@ -22,3 +22,4 @@ dist-ssr
*.njsproj
*.sln
*.sw?
.vercel
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React</title>
<title>Awesome Orange FE</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
<div id="root"><!--hydrate_root--></div>
<script type="module" src="/src/main-client.jsx"></script>
</body>
</html>
Loading

0 comments on commit 578fa27

Please sign in to comment.