Skip to content

Commit

Permalink
fixed env file and rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
ametel01 committed Dec 25, 2023
1 parent 4c553a3 commit e6b9680
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 49 deletions.
75 changes: 38 additions & 37 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,45 @@
# name: Deploy to Server
name: Deploy to Server

# on:
# push:
# branches:
# - master
on:
push:
branches:
- master

# jobs:
# deploy:
# runs-on: ubuntu-latest
# timeout-minutes: 30
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 30

# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
steps:
- name: Checkout repository
uses: actions/checkout@v4

# - name: Deploy to Server
# uses: appleboy/ssh-action@master
# with:
# host: ${{ secrets.HOST }}
# username: ${{ secrets.USERNAME }}
# key: ${{ secrets.DEPLOY_KEY }}
# script: |
# export NVM_DIR="$HOME/.nvm"
# [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
# nvm use 18
# cd /var/www/no-game.xyz/nogame-app
# git reset --hard origin/master
# git pull origin master
- name: Deploy to Server
uses: appleboy/ssh-action@v1.0.0
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.DEPLOY_KEY }}
script: |
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm use 18
cd /var/www/no-game.xyz/nogame-app
git reset --hard origin/master
git pull origin master
# # Decode and set backend .env
# cd packages/backend
# echo '${{ secrets.BACKEND_ENV_FILE }}' > .env
# npm install
# npm run build
# Decode and set backend .env
cd packages/testnet/backend
echo '${{ secrets.BACKEND_ENV_FILE }}' > .env
npm install
npm run build
# # Decode and set frontend .env
# cd ../frontend
# echo '${{ secrets.FRONTEND_ENV_FILE }}' > .env
# npm install
# npm run build
# Decode and set frontend .env
cd ../frontend
echo '${{ secrets.FRONTEND_ENV_FILE }}' > .env
npm install
npm run build
# # Restart PM2 processes
# pm2 restart all
# Restart PM2 processes
pm2 restart all
sudo systemctl reload nginx
4 changes: 2 additions & 2 deletions packages/testnet/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"@mui/joy": "^5.0.0-beta.17",
"@mui/material": "^5.14.20",
"@mui/system": "^5.14.20",
"@starknet-react/chains": "^0.1.1",
"@starknet-react/core": "^2.1.2",
"@starknet-react/chains": "^0.1.3",
"@starknet-react/core": "^2.1.5",
"bignumber.js": "^9.1.2",
"get-starknet-core": "^3.2.0",
"jotai": "^2.6.0",
Expand Down
22 changes: 12 additions & 10 deletions packages/testnet/frontend/src/components/provider/index.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
import { goerli } from "@starknet-react/chains";
import { goerli, sepolia} from "@starknet-react/chains";
import {
StarknetConfig,
infuraProvider,
argent,
braavos,
} from "@starknet-react/core";
import { jsonRpcProvider } from "@starknet-react/core";

function rpc() {
return {
nodeUrl: import.meta.env.BLAST_RPC,
}
}

// const alchemyKey = import.meta.env.VITE_ALCHEMY_APY_KEY;
const infuraKey = import.meta.env.VITE_INFURA_APY_KEY;

export function StarknetProvider({ children }: { children: React.ReactNode }) {
const chains = [goerli];
// const providers = [
// infuraProvider({ apiKey: infuraKey }),
// // alchemyProvider({ apiKey: alchemyKey }),
// // publicProvider(),
// ];
const chains = [goerli, sepolia];
const provider = jsonRpcProvider({ rpc });

const connectors = [argent(), braavos()];

return (
<StarknetConfig
autoConnect
chains={chains}
provider={infuraProvider({ apiKey: infuraKey })}
provider={provider}
connectors={connectors}
>
{children}
Expand Down

0 comments on commit e6b9680

Please sign in to comment.