Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copy values from the matching existing environment. Do not commit real values.
VITE_ETH_CHAIN_ID=
VITE_ETH_DORA_ADDRESSS=
VITE_BRIDGE_CONTRACT_ADDRESS=
VITE_ETHERSCAN_URL=
VITE_MAINNET_RPC_URL=
VITE_SEPOLIA_RPC_URL=
30 changes: 30 additions & 0 deletions .github/workflows/vercel-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Vercel build validation
on:
pull_request:
branches: [main, dora-migrate-vota]
workflow_dispatch:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '24'
- name: Install locked dependencies
run: npx --yes pnpm@8.6.6 install --frozen-lockfile
- name: Build with the target environment
env:
TARGET_BRANCH: ${{ github.base_ref || github.ref_name }}
MAIN_ENV: ${{ secrets.ENV_CONTENTS_MAIN }}
DEV_ENV: ${{ secrets.ENV_CONTENTS }}
shell: bash
run: |
if [ "$TARGET_BRANCH" = main ]; then
printf '%s' "$MAIN_ENV" > .env
else
printf '%s' "$DEV_ENV" > .env
fi
npx --yes pnpm@8.6.6 run build
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ dist-ssr
*.njsproj
*.sln
*.sw?

.vercel/
.env.*
!.env.example
7 changes: 7 additions & 0 deletions .vercelignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
dist
.git
.vercel
.env
.env.*
*.log
28 changes: 28 additions & 0 deletions docs/vercel-deployment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Vercel deployment

Both projects belong to the Dora Factory team (`dora-factory`).

| Environment | Vercel project | Production branch | Existing domain |
| --- | --- | --- | --- |
| Mainnet | vota-migration | main | vota-migration.dorafactory.org |
| Development (Sepolia) | vota-migration-dev | dora-migrate-vota | test-bridge.dorafactory.org |

Use the repository root, Vite, Node.js 24, pnpm 8.6.6, and `dist`. Commands and SPA fallback routing are defined in `vercel.json`. Each project uses Vercel Production with its own configuration; development is a separate application and branch, not the mainnet build in Preview mode.

## Build environment

Copy the appropriate existing GitHub secret (`ENV_CONTENTS_MAIN` or `ENV_CONTENTS`) into the matching Vercel project's Production environment variables. Do not mix environments or commit values. Vite embeds `VITE_` values in public browser assets: never put a server secret or a wallet private key in these variables. Keep the existing spelling `VITE_ETH_DORA_ADDRESSS`.

Mainnet uses `VITE_MAINNET_RPC_URL`, `VITE_SEPOLIA_RPC_URL`, `VITE_ETH_CHAIN_ID`, `VITE_ETH_DORA_ADDRESSS`, `VITE_BRIDGE_CONTRACT_ADDRESS`, and `VITE_ETHERSCAN_URL`. Development uses `VITE_INFURA_API_KEY` instead of the two RPC URL variables. `.env.example` lists the active variables for this branch. Optional features should retain their existing environment configuration.

The initial CLI migration recovered these active values from the JavaScript already served by the existing sites, because GitHub does not expose secret values. Other optional variables are unset in those published builds, including `VITE_PK_ENCRYPTION_KEY` and `VITE_DYDX_DENOM`; the migration keeps that behavior. This is not proof that their underlying GitHub secret files contain no unused settings.

## Git and cutover

Authorize the Vercel GitHub App for `DoraFactory/migration-user-interface`, connect both projects, and set the production branches shown above. If enabling previews, configure their variables deliberately to avoid accidentally using mainnet contracts in development. Restrict each project's production deployment to its corresponding branch.

The original Docker/ECR/EKS workflow is retained during migration. The added workflow validates the Vercel build on pull requests; it does not deploy. After validating Git-triggered deployment, add the existing domains to their matching Vercel projects, back up DNS records, then change DNS to the exact records Vercel recommends. Remove the old EKS workflow in a separate cutover change, once rollback and domain checks are complete.

## Validation

The application uses HashRouter. Check homepage, `/#/terms`, `/#/privacy`, consent dialog, wallet-selection dialog, correct Ethereum chain ID, and token/bridge contract addresses. Read-only RPC checks do not validate signing, token approval, or a migration transaction. Do not use a live wallet transaction as a deployment smoke test.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.0.0",
"type": "module",
"engines": {
"node": ">=18"
"node": "24.x"
},
"scripts": {
"dev": "vite",
Expand Down
13 changes: 13 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://openapi.vercel.sh/vercel.json",
"framework": "vite",
"installCommand": "npx --yes pnpm@8.6.6 install --frozen-lockfile",
"buildCommand": "npx --yes pnpm@8.6.6 run build",
"outputDirectory": "dist",
"rewrites": [
{
"source": "/(.*)",
"destination": "/index.html"
}
]
}
Loading