Skip to content

Commit

Permalink
fixed path in vite config+build command fix+preview fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitmalhotra1420 committed May 15, 2024
1 parent 8607c01 commit cd9da7d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,27 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install and Build
if: github.event.action != 'closed' # You might want to skip the build if the PR has been closed
env:
VITE_APP_NODE_ENV: ${{ secrets.VITE_APP_NODE_ENV }}
VITE_APP_DEPLOY_ENV: ${{ secrets.VITE_APP_DEPLOY_ENV }}
VITE_APP_PUBLIC_URL: ${{ secrets.VITE_APP_PUBLIC_URL }}
VITE_APP_WALLETCONNECT_PROJECT_ID: ${{ secrets.VITE_APP_WALLETCONNECT_PROJECT_ID }}

ESLINT_NO_DEV_ERRORS: ${{ secrets.ESLINT_NO_DEV_ERRORS }}
DISABLE_ESLINT_PLUGIN: ${{ secrets.DISABLE_ESLINT_PLUGIN }}
TSC_COMPILE_ON_ERROR: ${{ secrets.TSC_COMPILE_ON_ERROR }}

GENERATE_SOURCEMAP: ${{ secrets.GENERATE_SOURCEMAP }}

PR_PREVIEW_BASE: ${{ github.event.pull_request.number }}

run: |
yarn install
yarn build:pr:preview
- name: Deploy preview
uses: rossjrw/[email protected]
with:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"start:sdk:local:forcecleanup": "node dev-mode-link-local-sdk.mjs localsdk forcecleanup start",
"start:sdk:local:nocleanup": "node dev-mode-link-local-sdk.mjs localsdk nocleanup start",
"reset:sdk:prod": "node dev-mode-link-local-sdk.mjs prodsdk forcecleanup nostart",
"build:pr:preview": "NODE_OPTIONS=--max-old-space-size=8192 vite build",
"build:pr:preview": "node build.mjs dev && NODE_OPTIONS=--max-old-space-size=8192 vite build",
"build": "NODE_OPTIONS=--max-old-space-size=8192 node dev-mode-link-local-sdk.mjs prodsdk cleanup nostart && vite build",
"test": "vite test",
"deploy:alpha": "node build.mjs alpha && yarn build && echo 'alpha.push.org' > ./build/CNAME && gh-pages -d build -r https://github.com/push-protocol/push-dapp-alpha-deployment",
Expand Down
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export default defineConfig({
// this sets a default port to 3000
port: 3000,
},
base: process.env.PR_PREVIEW_BASE ? `/push-dapp/pr-preview/pr-${process.env.PR_PREVIEW_BASE}` : './',
build: {
outDir: 'build',
sourcemap: false,
Expand Down

0 comments on commit cd9da7d

Please sign in to comment.