Skip to content

Commit

Permalink
feat(testnet2): add testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
peppa committed Dec 16, 2024
1 parent e1e2ef5 commit cf22e53
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 4 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/coredao-deploy-testnet2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Deploy to Core Testnet2

on:
pull_request:

push:
branches: ['coredao/testnet2']

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
pull-requests: write
env:
ARCHIVE_NAME: ${{ github.event.repository.name }}
name: Deploy to testnet

steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}

# Post a PR comment before deploying
- name: Post a comment while building
if: github.event.number
uses: mshick/add-pr-comment@v2
with:
message-id: praul
message: |
## Branch preview
⏳ Deploying a preview site...
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: 'github-actions[bot]'

- uses: actions/checkout@v3

- uses: ./.github/workflows/yarn

- uses: ./.github/workflows/build
with:
secrets: ${{ toJSON(secrets) }}

- name: Create archive
run: tar -czf "$ARCHIVE_NAME".tar.gz dist

# Staging
- name: Deploy to the coredao
uses: cross-the-world/ssh-scp-ssh-pipelines@latest
with:
host: ${{ secrets.TESTNET2_HOST }}
user: ${{ secrets.TESTNET2_USER }}
key: ${{ secrets.TESTNET2_KEY }}
connect_timeout: 10s
first_ssh: |
mkdir ~/tmp | true
sudo mkdir /usr/share/nginx/safe | true
scp: |
$ARCHIVE_NAME.tar.gz => /home/ec2-user/tmp
last_ssh: |
cd tmp
tar -xzvf $ARCHIVE_NAME.tar.gz
sudo cp -rf /home/ec2-user/tmp/dist/* /usr/share/nginx/safe
rm -rf /home/ec2-user/tmp/dist
rm $ARCHIVE_NAME.tar.gz
- name: Clean
run: |
rm -rf dist
rm $ARCHIVE_NAME.tar.gz
4 changes: 2 additions & 2 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ const rewrites = async () => {
return {
fallback: [
{
source: "/coreapi/:path*",
destination: 'https://safe.test.btcs.network/api/:path*',
source: '/coreapi/:path*',
destination: 'https://safe.test2.btcs.network/api/:path*',
},
],
}
Expand Down
1 change: 0 additions & 1 deletion src/components/new-safe/create/steps/ReviewStep/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ const ReviewStep = ({ data, onSubmit, onBack, setStep }: StepRenderProps<NewSafe
setIsCreating(true)

try {
debugger
const readOnlyFallbackHandlerContract = await getReadOnlyFallbackHandlerContract(
chain.chainId,
LATEST_SAFE_VERSION,
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useChainId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { parsePrefixedAddress } from '@/utils/addresses'
import useWallet from './wallets/useWallet'
import useChains from './useChains'

const defaultChainId = IS_PRODUCTION ? chains.core : chains.tcore
const defaultChainId = IS_PRODUCTION ? chains.core : chains.tcore2

// Use the location object directly because Next.js's router.query is available only on mount
const getLocationQuery = (): ParsedUrlQuery => {
Expand Down

0 comments on commit cf22e53

Please sign in to comment.