Skip to content

Commit

Permalink
added github action
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitmalhotra1420 committed May 14, 2024
1 parent 8c337bf commit 10e67cb
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# .github/workflows/preview.yml
name: Deploy PR previews

on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed

concurrency: preview-${{ github.ref }}

jobs:
deploy-preview:
runs-on: ubuntu-20.04
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
run: |
yarn install
yarn build:pr:preview
- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./build/

- name: Delete Preview
- uses: rossjrw/pr-preview-action@v1
if: github.event.action == "closed" && !github.event.pull_request.merged
with:
source-dir: ./build/
action: remove
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:vercel": "NODE_OPTIONS=--max-old-space-size=8192 vite build",
"build:pr:preview": "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

0 comments on commit 10e67cb

Please sign in to comment.