2.1 KiB
Deploy
GitHub Pages
Primarily you need to specify your repo in js/packages/web/package.json
file
Pay attention to these two lines:
"deploy:gh": "yarn export && gh-pages -d ../../build/web --repo https://github.com/metaplex-foundation/metaplex -t true",
"deploy": "cross-env ASSET_PREFIX=/metaplex/ yarn build && yarn deploy:gh",
There are 2 things to change:
- specify your repo URL instead of
https://github.com/metaplex-foundation/metaplex
(for example,https://github.com/my-name/my-metaplex
) - set
ASSET_PREFIX
to repo name (for example,ASSET_PREFIX=/my-metaplex/
)
After that, the lines will look like this:
"deploy:gh": "yarn export && gh-pages -d ../../build/web --repo https://github.com/my-name/my-metaplex -t true",
"deploy": "cross-env ASSET_PREFIX=/my-metaplex/ yarn build && yarn deploy:gh",
And after that, you can publish the Metaplex app to GitHub Pages by the following commands:
cd js/packages/web
yarn deploy
Note that if you have 2fa enabled, you'll need to use a personal access token as your password:
GitHub Pages with a custom domain
If you have a custom domain linked to the GitHub Pages in your repo, then the instructions are the same as above, but your need to remove ASSET_PREFIX
from the deploy script:
"deploy:gh": "yarn export && gh-pages -d ../../build/web --repo https://github.com/my-name/my-metaplex -t true"
"deploy": "yarn build && yarn deploy:gh",
The publishing commands are the same:
cd js/packages/web
yarn deploy
Vercel
To publish the Metaplex app to Vercel, you first need to visit https://vercel.com/ and create a new project linked to your github repo. Then, create a pages/
directory under js
.
After that, configure this project with the following settings:
- Framework:
Next.js
- Root directory:
js
- Output directory:
packages/web/.next
One last thing: specify REACT_APP_STORE_OWNER_ADDRESS_ADDRESS
in the Environment Variables section