-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR Deploy Preview 🤝 meets 🤝 Github Pages (#1527)
* Implemented pull request deployment preview * Updated the yarn version for better compatibility and in future and avoiding yarn.lock issues. * Removed unused libraries. * Removed and fixed react import. * Removed unused imports. * Fixed assets path used from public or public/svg folder
- Loading branch information
1 parent
151ce74
commit 66a13f5
Showing
182 changed files
with
11,510 additions
and
13,621 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Deploy PR previews | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- closed | ||
branches: | ||
- main | ||
concurrency: preview-${{ github.ref }} | ||
jobs: | ||
deploy-preview: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Set up environment variables | ||
run: | | ||
echo "VITE_PR_PREVIEW_BASE=pr-${{ github.event.pull_request.number }}" >> $GITHUB_ENV | ||
echo "VITE_APP_NODE_ENV=production" >> $GITHUB_ENV | ||
echo "VITE_APP_DEPLOY_ENV=PREVIEW" >> $GITHUB_ENV | ||
echo "VITE_APP_PUBLIC_URL=https://push-protocol.github.io/" >> $GITHUB_ENV | ||
echo "ESLINT_NO_DEV_ERRORS=true" >> $GITHUB_ENV | ||
echo "TSC_COMPILE_ON_ERROR=true" >> $GITHUB_ENV | ||
echo "DISABLE_ESLINT_PLUGIN=true" >> $GITHUB_ENV | ||
echo "GENERATE_SOURCEMAP=true" >> $GITHUB_ENV | ||
- 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_WALLETCONNECT_PROJECT_ID: ${{ secrets.VITE_APP_WALLETCONNECT_PROJECT_ID }} | ||
|
||
run: | | ||
yarn install | ||
yarn build:pr:preview | ||
- name: Deploy preview | ||
uses: rossjrw/[email protected] | ||
with: | ||
source-dir: ./build/ | ||
|
||
- uses: rossjrw/[email protected] | ||
if: github.event.action == 'closed' && !github.event.pull_request.merged | ||
with: | ||
source-dir: ./build/ | ||
action: remove |
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
yarnPath: .yarn/releases/yarn-3.4.1.cjs | ||
compressionLevel: mixed | ||
|
||
enableGlobalCache: false | ||
|
||
nodeLinker: node-modules | ||
|
||
yarnPath: .yarn/releases/yarn-4.2.2.cjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export function getPreviewBasePath() { | ||
if (typeof import.meta !== 'undefined' && import.meta.env) { | ||
// Vite environment | ||
return import.meta.env.VITE_PR_PREVIEW_BASE ? `/push-dapp/pr-preview/${import.meta.env.VITE_PR_PREVIEW_BASE}` : ''; | ||
} else if (typeof process !== 'undefined' && process.env) { | ||
// Node.js environment (e.g., during the build process) | ||
return process.env.VITE_PR_PREVIEW_BASE ? `/push-dapp/pr-preview/${process.env.VITE_PR_PREVIEW_BASE}` : ''; | ||
} | ||
return ''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.