Skip to content

Commit

Permalink
Merge pull request #58 from KUIT-Space/gh-page
Browse files Browse the repository at this point in the history
Create github_pages.yml
  • Loading branch information
Turtle-Hwan authored Aug 4, 2024
2 parents e1178c8 + d5d23b7 commit 114e148
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 3 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/github_pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# GitHub Pages์— ์ •์  ์ฝ˜ํ…์ธ ๋ฅผ ๋ฐฐํฌํ•˜๊ธฐ ์œ„ํ•œ ๊ฐ„๋‹จํ•œ ์›Œํฌํ”Œ๋กœ์šฐ
name: Deploy static content to Pages

on:
# ๊ธฐ๋ณธ ๋ธŒ๋žœ์น˜์— ๋Œ€ํ•œ ํ‘ธ์‹œ ์ด๋ฒคํŠธ ๋ฐœ์ƒ ์‹œ ์‹คํ–‰
push:
branches: ['main']

# Actions ํƒญ์—์„œ ์ˆ˜๋™์œผ๋กœ ์›Œํฌํ”Œ๋กœ์šฐ๋ฅผ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ๋„๋ก ๊ตฌ์„ฑ
workflow_dispatch:

# GITHUB_TOKEN์˜ ๊ถŒํ•œ์„ ์„ค์ •ํ•˜์—ฌ GitHub Pages์— ๋ฐฐํฌํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•จ
permissions:
contents: read
pages: write
id-token: write

# ๋™์‹œ์— ํ•˜๋‚˜์˜ ๋ฐฐํฌ๋งŒ ํ—ˆ์šฉํ•˜๋„๋ก ๊ตฌ์„ฑ
concurrency:
group: 'pages'
cancel-in-progress: true

jobs:
# ๋‹จ์ˆœํžˆ ๋ฐฐํฌ๋งŒ ์ˆ˜ํ–‰ํ•˜๊ธฐ์— ํ•˜๋‚˜์˜ ์žก์œผ๋กœ๋งŒ ๊ตฌ์„ฑ
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci

# env ํŒŒ์ผ ์ƒ์„ฑ ํ›„ backend url ๋„ฃ์–ด์ฃผ๊ธฐ
- name: Generate env file
run: |
touch .env
echo "VITE_API_BACK_URL=$VITE_API_BACK_URL" >> .env
env:
VITE_API_BACK_URL: ${{ secrets.VITE_API_BACK_URL }}

- name: Build
run: npm run build

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Upload artifact
uses: actions/[email protected]
with:
# dist ๋””๋ ‰ํ„ฐ๋ฆฌ ์—…๋กœ๋“œ
path: './dist'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
4 changes: 2 additions & 2 deletions tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"noFallthroughCasesInSwitch": true,

//
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default defineConfig({
},
build: {
rollupOptions: {
external: ["react", "react-dom", "styled-components"],
// external: ["react", "react-dom", "styled-components"],
},
},
});

0 comments on commit 114e148

Please sign in to comment.