Skip to content

Commit

Permalink
Merge pull request #9 from gnosischain/dev
Browse files Browse the repository at this point in the history
Sync dev and main branch
  • Loading branch information
Wagalidoom authored Jul 17, 2024
2 parents 5574863 + 645d36a commit 7c0cb5d
Show file tree
Hide file tree
Showing 8 changed files with 98 additions and 12 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/dev_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Automatic Deployment to Dev/Staging

on:
# Launches for pushes to main or dev
push:
branches:
- main
- dev

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
VITE_WALLET_CONNECT_PROJECT_ID: ${{ secrets.VITE_WALLET_CONNECT_PROJECT_ID }}

jobs:
deploy:
name: Deployment
runs-on: ubuntu-latest

steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v4

- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '20.3.0'

- name: Install
run: |
rm -rf .cache
rm -rf build
yarn config set cache-folder .yarn
yarn install
pip install awscli --upgrade --user
- name: Build App
run: yarn build

- name: Configure AWS Development credentials
uses: aws-actions/configure-aws-credentials@v1
if: ( github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/main' )
with:
aws-access-key-id: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.DEV_AWS_DEFAULT_REGION }}

# Script to deploy to development environment
- name: 'Deploy to S3: Development'
if: github.ref == 'refs/heads/dev'
run: |
aws s3 sync dist/ s3://${{ secrets.DEV_BUCKET_NAME }}/dev --exclude "*.html" --cache-control max-age=0,no-cache,no-store,public --delete
aws s3 sync dist/ s3://${{ secrets.DEV_BUCKET_NAME }}/dev --exclude "*" --include "*.html" --cache-control max-age=0,no-cache,no-store,must-revalidate --content-type text/html --delete
# Script to deploy to staging environment
- name: 'Deploy to S3: Staging'
if: github.ref == 'refs/heads/main'
run: |
aws s3 sync dist/ s3://${{ secrets.DEV_BUCKET_NAME }}/main --exclude "*.html" --cache-control max-age=0,no-cache,no-store,public --delete
aws s3 sync dist/ s3://${{ secrets.DEV_BUCKET_NAME }}/main --exclude "*" --include "*.html" --cache-control max-age=0,no-cache,no-store,must-revalidate --content-type text/html --delete
- name: 'Cloudfront: cache invalidation'
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.DEV_AWS_CLOUDFRONT_ID }} --paths "/*"
15 changes: 15 additions & 0 deletions public/gnosisGreen.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
2 changes: 1 addition & 1 deletion src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const Header = () => {
return (
<div className="w-full sticky top-0 z-20 flex justify-between items-center p-3 bg-primary">
<div className="flex gap-x-2 items-center text-2xl">
<Image src="/gnosis.svg" alt="Gnosis" width={40} height={40} /> Gnosis Shutter
<Image src="/gnosisWhite.svg" alt="Gnosis" width={40} height={40} /> Gnosis Shutter
</div>
<Connect />
</div>
Expand Down
11 changes: 5 additions & 6 deletions src/constants/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,17 @@ export const nativeXDaiToken: Token = {
name: "xDai",
symbol: "xDai",
decimals: 18,
img: "/gnosis.svg",
img: "/xdai.png",
};

export const CHAINS: EnhancedChain[] = [
{
...gnosis,
img: "/gnosis.svg",
img: "/gnosisGreen.svg",
contracts: {
...gnosis.contracts,
sequencer: {
address: "0xc5C4b277277A1A8401E0F039dfC49151bA64DC2E",
// blockCreated: ,
},
keyperSetManager: {
address: "0x7C2337f9bFce19d8970661DA50dE8DD7d3D34abb",
Expand Down Expand Up @@ -84,13 +83,13 @@ export const CHAINS: EnhancedChain[] = [
name: "GnosisBridged",
symbol: "GNO",
decimals: 18,
img: "/xdai.png",
img: "/gnosisGreen.svg",
},
],
},
{
...gnosisChiado,
img: "/gnosis.svg",
img: "/gnosisGreen.svg",
contracts: {
...gnosisChiado.contracts,
sequencer: {
Expand Down Expand Up @@ -125,7 +124,7 @@ export const CHAINS: EnhancedChain[] = [
name: "GnosisBridged",
symbol: "GNO",
decimals: 18,
img: "/xdai.png",
img: "/gnosisGreen.svg",
},
],
},
Expand Down
4 changes: 1 addition & 3 deletions src/hooks/useSignTransaction.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { useCallback, useEffect, useState } from "react";
import { useCallback } from "react";

import { useCreateWalletClient } from "@/hooks/useCreateWalletClient";
import { getTransactionCount } from "wagmi/actions";
import { wagmiConfig } from "@/components/Web3ModalProvider";

export const useSignTransaction = () => {
const client = useCreateWalletClient();
Expand Down
1 change: 0 additions & 1 deletion src/pages/MainPage/FormsWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { useShutterEncryption } from "@/hooks/useShutterEncryption";
import { TransferForm } from "./TransferForm";
import { AdvancedForm } from "./AdvancedForm";
import { ProgressInfoCard } from "./ProgressInfoCard";
import { base } from "viem/chains";

// status = 0 -> preparing
// status = 1 -> signing
Expand Down
2 changes: 1 addition & 1 deletion src/pages/MainPage/TransferForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const TransferForm = ({ submit, status, isSubmitDisabled }: TransferFormP
}, [chain]);

useEffect(() => {
const selectedChain = mappedChains.find(c => c.id === chainId);
const selectedChain = mappedChains.find((c: { id: number; }) => c.id === chainId);
if (selectedChain) {
setChain(selectedChain);
}
Expand Down

0 comments on commit 7c0cb5d

Please sign in to comment.