-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #196 from polywrap/release/dev
Prod Release Feb 20th
- Loading branch information
Showing
145 changed files
with
9,566 additions
and
2,567 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
name: CD Prod | ||
|
||
on: | ||
push: | ||
branches: | ||
- release/prod | ||
|
||
jobs: | ||
Deploy-API: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install Poetry | ||
run: | | ||
curl -sSL https://install.python-poetry.org | python3 - | ||
- name: Read .nvmrc | ||
run: echo ::set-output name=NVMRC::$(cat .nvmrc) | ||
id: nvm | ||
working-directory: ./workers | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@master | ||
with: | ||
node-version: '${{ steps.nvm.outputs.NVMRC }}' | ||
|
||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
working-directory: ./workers | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Install dependencies | ||
run: (yarn install --nonInteractive --frozen-lockfile --prefer-offline || yarn install --nonInteractive --frozen-lockfile --prefer-offline) | ||
working-directory: ./workers | ||
|
||
# TODO: rename to all "dev" here to prod and update aws accordingly | ||
- name: Deploy | ||
run: yarn deploy:dev | ||
working-directory: ./workers | ||
env: | ||
DEPLOYMENT_STAGE: dev | ||
AWS_ACCESS_KEY_ID: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }} | ||
DEV_INNGEST_SIGNING_KEY: ${{ secrets.DEV_INNGEST_SIGNING_KEY }} | ||
DEV_INNGEST_EVENT_KEY: ${{ secrets.DEV_INNGEST_EVENT_KEY }} | ||
DEV_NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.PROD_NEXT_PUBLIC_SUPABASE_URL }} | ||
DEV_NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.PROD_NEXT_PUBLIC_SUPABASE_ANON_KEY }} | ||
DEV_SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.PROD_SUPABASE_SERVICE_ROLE_KEY }} | ||
DEV_OPENAI_API_KEY: ${{ secrets.DEV_OPENAI_API_KEY}} | ||
DEV_PINECONE_API_KEY: ${{ secrets.DEV_PINECONE_API_KEY }} | ||
|
||
Deploy-DB: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Read .nvmrc | ||
run: echo ::set-output name=NVMRC::$(cat .nvmrc) | ||
id: nvm | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@master | ||
with: | ||
node-version: '${{ steps.nvm.outputs.NVMRC }}' | ||
|
||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Install dependencies | ||
run: cp ../yarn.lock ./ && (yarn install --nonInteractive --frozen-lockfile --prefer-offline || yarn install --nonInteractive --frozen-lockfile --prefer-offline) | ||
working-directory: ./web | ||
|
||
- uses: supabase/setup-cli@v1 | ||
with: | ||
version: latest | ||
- run: supabase link --project-ref $PROJECT_ID --password $DB_PASSWORD --debug | ||
working-directory: ./web | ||
env: | ||
DB_PASSWORD: ${{ secrets.PROD_SUPABASE_DB_PASSWORD }} | ||
PROJECT_ID: ${{ secrets.PROD_SUPABASE_PROJECT_ID }} | ||
SUPABASE_ACCESS_TOKEN: ${{ secrets.DEV_SUPABASE_ACCESS_TOKEN }} | ||
|
||
- run: supabase db push --password $DB_PASSWORD | ||
working-directory: ./web | ||
env: | ||
DB_PASSWORD: ${{ secrets.PROD_SUPABASE_DB_PASSWORD }} | ||
SUPABASE_ACCESS_TOKEN: ${{ secrets.DEV_SUPABASE_ACCESS_TOKEN }} | ||
|
||
# TODO: update to api.fundpublicgoods.ai once updated in AWS | ||
- run: curl -X PUT https://api.dev.fundpublicgoods.ai/api/inngest |
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
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 |
---|---|---|
|
@@ -31,4 +31,4 @@ | |
"concurrently": "8.2.2", | ||
"inngest-cli": "^0.23.1" | ||
} | ||
} | ||
} |
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,86 @@ | ||
"use client"; | ||
|
||
import { Logo } from "@/components/Logo"; | ||
import truncateEthAddress from "@/utils/ethereum/truncateAddress"; | ||
import { CaretDown, Link } from "@phosphor-icons/react"; | ||
import { useConnectWallet } from "@web3-onboard/react"; | ||
import Image from "next/image"; | ||
import { useEffect, useRef, useState } from "react"; | ||
|
||
function Header() { | ||
const [{ wallet }, _, disconnect] = useConnectWallet(); | ||
const [showDropdownMenu, setShowDropdownMenu] = useState<boolean>(false); | ||
const dropdownRef = useRef<HTMLDivElement | null>(null); | ||
|
||
useEffect(() => { | ||
function handleClickOutside(event: MouseEvent) { | ||
const current = dropdownRef.current; | ||
if (current && !current.contains(event.target as Node)) { | ||
setShowDropdownMenu(false); | ||
} | ||
} | ||
|
||
// Bind the event listener | ||
if (showDropdownMenu) { | ||
document.addEventListener("mousedown", handleClickOutside); | ||
} | ||
|
||
// Unbind the event listener on clean up | ||
return () => { | ||
document.removeEventListener("mousedown", handleClickOutside); | ||
}; | ||
}, [showDropdownMenu]); | ||
|
||
return ( | ||
<div className='flex w-full justify-between text-sm px-6 py-4 bg-indigo-300/80 border-b-2 border-indigo-400/20'> | ||
<a href='/' className='flex'> | ||
<Logo size={160} /> | ||
</a> | ||
{wallet && ( | ||
<div className='relative' ref={dropdownRef}> | ||
<div | ||
onClick={() => setShowDropdownMenu((current) => !current)} | ||
className='text-indigo-600 hover:text-indigo-800 font-bold text-sm cursor-pointer flex space-x-1 items-center p-1 rounded-md hover:bg-indigo-500/20'> | ||
<div> | ||
{wallet.accounts[0]?.ens?.name ? ( | ||
<div className='flex items-center space-x-2'> | ||
{wallet.accounts[0]?.ens?.avatar && ( | ||
<Image | ||
className='min-w-[20px] h-5 rounded-full object-fit bg-white' | ||
src={wallet.accounts[0]?.ens?.avatar.toString()} | ||
alt={wallet.accounts[0]?.ens?.name} | ||
width={20} | ||
height={20} | ||
/> | ||
)} | ||
<div>{wallet.accounts[0]?.ens?.name}</div> | ||
</div> | ||
) : ( | ||
<div>{truncateEthAddress(wallet.accounts[0].address)}</div> | ||
)} | ||
</div> | ||
<CaretDown weight='bold' /> | ||
</div> | ||
{showDropdownMenu ? <div className='absolute top-[calc(100%+8px)] right-0 z-10' > | ||
<div className='bg-indigo-50 rounded-2xl border-2 border-indigo-300 space-y-2 p-3 shadow-xl shadow-primary-shadow/20'> | ||
<div | ||
className="p-2 flex items-center space-x-2 hover:bg-white cursor-pointer w-full rounded-xl" | ||
onClick={() => { | ||
disconnect(wallet); | ||
setShowDropdownMenu(!showDropdownMenu) | ||
}} | ||
> | ||
<Link size={16} weight='bold' className='min-w-[16px]' /> | ||
<div className='whitespace-nowrap'> | ||
Disconnect Wallet | ||
</div> | ||
</div> | ||
</div> | ||
</div> : null} | ||
</div> | ||
)} | ||
</div> | ||
); | ||
} | ||
|
||
export default Header; |
Oops, something went wrong.