From ba4906635e1d8b2719f79873629e75786624dd05 Mon Sep 17 00:00:00 2001 From: "lkh14011424@gmail.com" Date: Sun, 17 Nov 2024 23:27:09 +0900 Subject: [PATCH] =?UTF-8?q?[feat/#123]=20=EB=B9=8C=EB=93=9C=20=EA=B2=BD?= =?UTF-8?q?=EB=A1=9C=20=EC=88=98=EC=A0=95,=20main.yml=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main.yml | 36 ++++++++++-------------------------- package.json | 1 + src/electron/main.ts | 4 ++-- vite.config.ts | 3 +++ 4 files changed, 16 insertions(+), 28 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 58e9d0e..6d618ee 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,7 +4,7 @@ on: branches: - develop jobs: - build: + build-and-deploy: runs-on: ubuntu-20.04 steps: - name: Checkout source code @@ -22,46 +22,30 @@ jobs: - name: Install dependencies run: yarn install - - name: Generate web build - id: build_web + - name: Generate web and Electron builds + id: build env: VITE_API_BASE_URL: ${{ secrets.VITE_API_BASE_URL }} VITE_OAUTH_KAKAO_REST_API_KEY: ${{ secrets.VITE_OAUTH_KAKAO_REST_API_KEY }} VITE_OAUTH_KAKAO_CLIENT_SECRET_CODE: ${{ secrets.VITE_OAUTH_KAKAO_CLIENT_SECRET_CODE }} VITE_OAUTH_KAKAO_REDIRECT_URI: ${{ secrets.VITE_OAUTH_KAKAO_REDIRECT_URI }} - run: yarn build - continue-on-error: true + run: | + echo "Starting Web and Electron build..." + yarn electron:build - - name: Deploy to S3 + - name: Deploy builds to S3 id: deploy if: steps.build.outcome == 'success' env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} run: | - aws s3 sync --region ap-northeast-2 dist s3://alignlab-client --delete - continue-on-error: true + echo "Deploying web build to S3..." + aws s3 sync --region ap-northeast-2 dist/web s3://alignlab-client --delete - - name: Generate Electron build - id: build_electron - env: - VITE_API_BASE_URL: ${{ secrets.VITE_API_BASE_URL }} - VITE_OAUTH_KAKAO_REST_API_KEY: ${{ secrets.VITE_OAUTH_KAKAO_REST_API_KEY }} - VITE_OAUTH_KAKAO_CLIENT_SECRET_CODE: ${{ secrets.VITE_OAUTH_KAKAO_CLIENT_SECRET_CODE }} - VITE_OAUTH_KAKAO_REDIRECT_URI: ${{ secrets.VITE_OAUTH_KAKAO_REDIRECT_URI }} - run: yarn electron:build - continue-on-error: true - - - name: Deploy Electron build to S3 - id: deploy_electron - if: steps.build_electron.outcome == 'success' - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - run: | + echo "Deploying Electron build to S3..." aws s3 cp out/make/squirrel.windows/AlignLabInstaller.exe s3://alignlab-client/installer/AlignLabInstaller.exe --region ap-northeast-2 aws s3 cp out/make/dmg/AlignLab.dmg s3://alignlab-client/installer/AlignLab.dmg --region ap-northeast-2 - continue-on-error: true - name: Invalidate CloudFront Cache if: steps.deploy.outcome == 'success' diff --git a/package.json b/package.json index 0a139be..d231830 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "1.0.0", "main": "dist/main.js", "license": "MIT", + "description": "alignlab", "build": { "extends": null }, diff --git a/src/electron/main.ts b/src/electron/main.ts index 31631c2..b46c5c6 100644 --- a/src/electron/main.ts +++ b/src/electron/main.ts @@ -20,9 +20,9 @@ function createWindow() { mainWindow.webContents.openDevTools() } else if (isPreview) { mainWindow.webContents.openDevTools() - mainWindow.loadFile("dist/index.html") + mainWindow.loadFile("dist/web/index.html") } else { - mainWindow.loadFile("dist/index.html") + mainWindow.loadFile("dist/web/index.html") } } diff --git a/vite.config.ts b/vite.config.ts index c06f6b1..a528965 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -5,6 +5,9 @@ import tsconfigPaths from "vite-tsconfig-paths" export default defineConfig({ plugins: [react(), tsconfigPaths(), svgrPlugin()], + build: { + outDir: "dist/web" + }, server: { port: 3000, },