Skip to content

Commit

Permalink
[feat/#123] 빌드 경로 수정, main.yml 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
lkhoony committed Nov 17, 2024
1 parent e2da907 commit ba49066
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 28 deletions.
36 changes: 10 additions & 26 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
branches:
- develop
jobs:
build:
build-and-deploy:
runs-on: ubuntu-20.04
steps:
- name: Checkout source code
Expand All @@ -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'
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.0.0",
"main": "dist/main.js",
"license": "MIT",
"description": "alignlab",
"build": {
"extends": null
},
Expand Down
4 changes: 2 additions & 2 deletions src/electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}

Expand Down
3 changes: 3 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import tsconfigPaths from "vite-tsconfig-paths"

export default defineConfig({
plugins: [react(), tsconfigPaths(), svgrPlugin()],
build: {
outDir: "dist/web"
},
server: {
port: 3000,
},
Expand Down

0 comments on commit ba49066

Please sign in to comment.