metaplex/docs/deploy.md

64 lines
2.1 KiB
Markdown
Raw Normal View History

2021-07-22 01:01:27 -07:00
# Deploy
## GitHub Pages
Primarily you need to specify your repo in `js/packages/web/package.json` file
Pay attention to these two lines:
```json
"deploy:gh": "yarn export && gh-pages -d ../../build/web --repo https://github.com/metaplex-foundation/metaplex -t true",
2021-07-29 01:56:57 -07:00
"deploy": "cross-env ASSET_PREFIX=/metaplex/ yarn build && yarn deploy:gh",
2021-07-22 01:01:27 -07:00
```
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:
```json
"deploy:gh": "yarn export && gh-pages -d ../../build/web --repo https://github.com/my-name/my-metaplex -t true",
2021-07-29 01:56:57 -07:00
"deploy": "cross-env ASSET_PREFIX=/my-metaplex/ yarn build && yarn deploy:gh",
2021-07-22 01:01:27 -07:00
```
And after that, you can publish the Metaplex app to GitHub Pages by the following commands:
```bash
cd js/packages/web
yarn deploy
```
2021-08-02 20:27:24 -07:00
Note that if you have 2fa enabled, you'll need to use a personal access token as your password:
https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token
2021-07-22 01:01:27 -07:00
### 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:
```json
"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:
```bash
cd js/packages/web
yarn deploy
```
## Vercel
To publish the Metaplex app to Vercel, you first need to visit [https://vercel.com/](https://vercel.com/) and create a new project linked to your github repo. Then, create a `pages/` directory under `js`.
2021-07-22 01:01:27 -07:00
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