From 8baea3b8976ef60b5f0326058f4229165f0d3c87 Mon Sep 17 00:00:00 2001 From: inseongso-29cm Date: Tue, 26 Mar 2024 15:48:24 +0900 Subject: [PATCH] chore: deploy --- .github/workflows/deploy.yaml | 51 +++++++++++++++++++++++++++++++++++ vite.config.ts | 1 + 2 files changed, 52 insertions(+) create mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..4c08eb6 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,51 @@ +# 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: 'pnpm' + - name: Install dependencies + run: pnpm ci + - name: Build + run: pnpm run build + - name: Setup Pages + uses: actions/configure-pages@v4 + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + # dist 디렉터리 업로드 + path: './dist' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/vite.config.ts b/vite.config.ts index 5a33944..48b78fe 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -3,5 +3,6 @@ import react from '@vitejs/plugin-react' // https://vitejs.dev/config/ export default defineConfig({ + base: '/image-component/', plugins: [react()], })