From 4a1028d7a51b74a021f5de7eb27400d5228bd7e0 Mon Sep 17 00:00:00 2001 From: Atif Ather <40694397+atifather@users.noreply.github.com> Date: Tue, 11 Jul 2023 20:42:59 +0500 Subject: [PATCH 01/13] Create review-app.txt --- review-app.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 review-app.txt diff --git a/review-app.txt b/review-app.txt new file mode 100644 index 0000000..eeb547f --- /dev/null +++ b/review-app.txt @@ -0,0 +1 @@ +This is test file for review app. From c7af99df3e7145a9fbdae05772acb1ffffda70db Mon Sep 17 00:00:00 2001 From: Giacomo Licari Date: Mon, 4 Sep 2023 13:10:47 +0200 Subject: [PATCH 02/13] Heroku Preview-Apps: add app.json --- app.json | 7 +++++++ review-app.txt | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 app.json delete mode 100644 review-app.txt diff --git a/app.json b/app.json new file mode 100644 index 0000000..06cef8d --- /dev/null +++ b/app.json @@ -0,0 +1,7 @@ +{ + "name": "gbc-deposit-ui", + "description": "Gnosis Beacon Chain Deposit UI", + "env": { + "REACT_APP_NETWORK_IDS": "100,10200" + } +} \ No newline at end of file diff --git a/review-app.txt b/review-app.txt deleted file mode 100644 index eeb547f..0000000 --- a/review-app.txt +++ /dev/null @@ -1 +0,0 @@ -This is test file for review app. From 7d8ef225cc0f53197880f693acdfa79f0891f967 Mon Sep 17 00:00:00 2001 From: Giacomo Licari Date: Mon, 4 Sep 2023 13:42:12 +0200 Subject: [PATCH 03/13] Heroku Preview Apps: add scripts to app.json --- app.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app.json b/app.json index 06cef8d..fc395c1 100644 --- a/app.json +++ b/app.json @@ -3,5 +3,8 @@ "description": "Gnosis Beacon Chain Deposit UI", "env": { "REACT_APP_NETWORK_IDS": "100,10200" + }, + "scripts": { + "postdeploy": "npm run build" } } \ No newline at end of file From 8f7ba1530258430150dbd5584d27f1179613bf6a Mon Sep 17 00:00:00 2001 From: Giacomo Licari Date: Mon, 4 Sep 2023 14:31:15 +0200 Subject: [PATCH 04/13] Heroku Preview Apps: change startup command, use npm run build --- Procfile | 1 + app.json | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) create mode 100644 Procfile diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..972deb6 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: node --optimize_for_size --max_old_space_size=1024 -s build \ No newline at end of file diff --git a/app.json b/app.json index fc395c1..06cef8d 100644 --- a/app.json +++ b/app.json @@ -3,8 +3,5 @@ "description": "Gnosis Beacon Chain Deposit UI", "env": { "REACT_APP_NETWORK_IDS": "100,10200" - }, - "scripts": { - "postdeploy": "npm run build" } } \ No newline at end of file From c59139cc61511b2ac0bb0394ea9eea31cb71c6a4 Mon Sep 17 00:00:00 2001 From: Giacomo Licari Date: Mon, 4 Sep 2023 14:51:52 +0200 Subject: [PATCH 05/13] Heroku Preview Apps: add NODE_OPTIONS to app.json --- Procfile | 1 - app.json | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 Procfile diff --git a/Procfile b/Procfile deleted file mode 100644 index 972deb6..0000000 --- a/Procfile +++ /dev/null @@ -1 +0,0 @@ -web: node --optimize_for_size --max_old_space_size=1024 -s build \ No newline at end of file diff --git a/app.json b/app.json index 06cef8d..738c031 100644 --- a/app.json +++ b/app.json @@ -2,6 +2,7 @@ "name": "gbc-deposit-ui", "description": "Gnosis Beacon Chain Deposit UI", "env": { - "REACT_APP_NETWORK_IDS": "100,10200" + "REACT_APP_NETWORK_IDS": "100,10200", + "NODE_OPTIONS": "--max_old_space_size=1024" } } \ No newline at end of file From 7ae806a02a034ccdc2f8e3cd378ff96be017970c Mon Sep 17 00:00:00 2001 From: Giacomo Licari Date: Mon, 4 Sep 2023 16:33:35 +0200 Subject: [PATCH 06/13] PR Preview: Add Github Action --- .github/workflows/pr-preview.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/pr-preview.yml diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml new file mode 100644 index 0000000..75953d4 --- /dev/null +++ b/.github/workflows/pr-preview.yml @@ -0,0 +1,31 @@ +name: PR-Preview + +on: + pull_request: + branches: [ main ] + + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Yarn Install and Build + run: | + npm install + npm run build + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Deploy website to pr-review + run: aws s3 sync ./build/ s3://${{ secrets.AWS_BUCKET_NAME }}/pr-${{ github.event.number }}/ --delete \ No newline at end of file From 928423af8671d9a0110988270c77b36feb4db98b Mon Sep 17 00:00:00 2001 From: Giacomo Licari Date: Mon, 4 Sep 2023 16:43:21 +0200 Subject: [PATCH 07/13] Remove unused isValidElement from use-wallet.js --- .github/workflows/pr-preview.yml | 2 +- src/hooks/use-wallet.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index 75953d4..e2c5ef3 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -15,7 +15,7 @@ jobs: with: node-version: 16 - - name: Yarn Install and Build + - name: NPM Install and Build run: | npm install npm run build diff --git a/src/hooks/use-wallet.js b/src/hooks/use-wallet.js index 233cb6b..886d58c 100644 --- a/src/hooks/use-wallet.js +++ b/src/hooks/use-wallet.js @@ -1,4 +1,4 @@ -import { useState, useCallback, useEffect, isValidElement } from 'react'; +import { useState, useCallback, useEffect } from 'react'; import { SafeAppWeb3Modal } from '@gnosis.pm/safe-apps-web3modal'; import WalletConnectProvider from '@walletconnect/web3-provider'; import WalletLink from 'walletlink'; From b846129a17e53d888b911311eaafae5f43e2d2f4 Mon Sep 17 00:00:00 2001 From: Giacomo Licari Date: Mon, 4 Sep 2023 17:01:01 +0200 Subject: [PATCH 08/13] PR Preview: set NodeJS to v16.14.2 --- .github/workflows/pr-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index e2c5ef3..efd1c56 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 16.14.2 - name: NPM Install and Build run: | From 55dfe5c08d510102882d2ea10b79bf7a57e53330 Mon Sep 17 00:00:00 2001 From: Giacomo Licari Date: Mon, 4 Sep 2023 18:01:38 +0200 Subject: [PATCH 09/13] Remove app.json, add PUBLIC_URL to build in CI --- .github/workflows/pr-preview.yml | 3 +++ app.json | 8 -------- 2 files changed, 3 insertions(+), 8 deletions(-) delete mode 100644 app.json diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index efd1c56..cf0adbb 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -15,6 +15,9 @@ jobs: with: node-version: 16.14.2 + - name: Set env + run: echo "PUBLIC_URL=./" >> $GITHUB_ENV + - name: NPM Install and Build run: | npm install diff --git a/app.json b/app.json deleted file mode 100644 index 738c031..0000000 --- a/app.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "gbc-deposit-ui", - "description": "Gnosis Beacon Chain Deposit UI", - "env": { - "REACT_APP_NETWORK_IDS": "100,10200", - "NODE_OPTIONS": "--max_old_space_size=1024" - } -} \ No newline at end of file From 8426b6dda68e6ee9c5e336261cd0b8143cfa17ae Mon Sep 17 00:00:00 2001 From: Giacomo Licari Date: Mon, 4 Sep 2023 18:24:04 +0200 Subject: [PATCH 10/13] Add REACT_APP_NETWORK_IDS to CI --- .github/workflows/pr-preview.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index cf0adbb..0ef908a 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -4,6 +4,8 @@ on: pull_request: branches: [ main ] +env: + REACT_APP_NETWORK_IDS: "100,10200" jobs: deploy: From e513e53d92c9cca2ba48ce25470cc227a8f6c298 Mon Sep 17 00:00:00 2001 From: Giacomo Licari Date: Mon, 4 Sep 2023 20:52:08 +0200 Subject: [PATCH 11/13] Github Actions: get node version from package.json, set env variables at root level --- .github/workflows/pr-preview.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index 0ef908a..361491c 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -6,6 +6,7 @@ on: env: REACT_APP_NETWORK_IDS: "100,10200" + GITHUB_ENV: "./" jobs: deploy: @@ -15,10 +16,7 @@ jobs: - uses: actions/setup-node@v3 with: - node-version: 16.14.2 - - - name: Set env - run: echo "PUBLIC_URL=./" >> $GITHUB_ENV + node-version-file: 'package.json' - name: NPM Install and Build run: | From 24a588b621346f21363f285869cd68c63d34e364 Mon Sep 17 00:00:00 2001 From: Giacomo <4820738+giacomolicari@users.noreply.github.com> Date: Tue, 5 Sep 2023 08:26:16 +0200 Subject: [PATCH 12/13] Update .github/workflows/pr-preview.yml Co-authored-by: Philippe Schommers --- .github/workflows/pr-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index 361491c..bd28a5a 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -6,7 +6,7 @@ on: env: REACT_APP_NETWORK_IDS: "100,10200" - GITHUB_ENV: "./" + PUBLIC_URL: "./" jobs: deploy: From 2e28fad41023a3e961f0834f62fe37283430b534 Mon Sep 17 00:00:00 2001 From: Giacomo Licari Date: Tue, 5 Sep 2023 08:30:18 +0200 Subject: [PATCH 13/13] Add comments to PUBLIC_URL --- .github/workflows/pr-preview.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index bd28a5a..fbaf1f4 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -6,6 +6,8 @@ on: env: REACT_APP_NETWORK_IDS: "100,10200" + # Ref: https://create-react-app.dev/docs/using-the-public-folder/ + # Scope of Public URL: rewrite href base path to the one specified by PUBLIC_URL. PUBLIC_URL: "./" jobs: