Skip to content

Commit

Permalink
Website build action: set the Infura API key (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
bpierre authored May 25, 2021
1 parent 848c35f commit 0012463
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
run: yarn install --immutable && yarn build --noStats

- name: Build website/
env:
VITE_INFURA_KEY: ${{ secrets.INFURA_KEY }}
run: cd website && yarn install --immutable && yarn build

- name: Deploy
Expand Down
4 changes: 1 addition & 3 deletions examples/ethers/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import nfts from "../../nfts"

const ethersConfig = {
ethers: { Contract },
provider: getDefaultProvider("homestead", {
infura: import.meta.env.VITE_INFURA_KEY,
}),
provider: getDefaultProvider("homestead"),
}

function App() {
Expand Down
9 changes: 5 additions & 4 deletions website/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react"
import { getDefaultProvider, Contract } from "ethers"
import { providers, Contract } from "ethers"
import { NftProvider, FetcherDeclarationEthers } from "use-nft"
import Base from "./Base"
import Footer from "./Footer"
Expand All @@ -11,9 +11,10 @@ const fetcher = [
"ethers",
{
ethers: { Contract },
provider: getDefaultProvider("homestead", {
infura: import.meta.env.VITE_INFURA_KEY,
}),
provider: new providers.InfuraProvider(
"homestead",
import.meta.env.VITE_INFURA_KEY
),
},
]

Expand Down

0 comments on commit 0012463

Please sign in to comment.