Skip to content

Instantly share code, notes, and snippets.

@onggunhao
Last active December 12, 2017 07:55
Show Gist options
  • Save onggunhao/202f57cde9fb4f2d8e56ab414043aa1c to your computer and use it in GitHub Desktop.
Save onggunhao/202f57cde9fb4f2d8e56ab414043aa1c to your computer and use it in GitHub Desktop.

Deploying Bitcoin-VR on Github Pages

Before

  1. Read Facebook's React VR deployment guide.
  2. Copy the list of static assets files in reactvrinit.js. (TODO: write automated script to handle this)
ReactVR.init(
  // When you're ready to deploy your app, update this line to point to
  // your compiled index.bundle.js
  './index.bundle.js?platform=vr',
  // Attach it to the body tag
  document.body,
  {},
  [ './static_assets/Air_Balloon.mtl',
    './static_assets/Air_Balloon.obj',
    './static_assets/lake-medium.jpg',
    './static_assets/lake-large.jpg',
    './static_assets/Low-Poly_airship.mtl',
    './static_assets/Low-Poly_airship.obj',
  ]
);
  1. Copy static_assets folder into vr/build/static_assets

Deploying to Github Pages

Note that the vr/build folder already has a git repository, with origin/master set to the bitcoin-vr.github.io. Pushing to origin/master will trigger the github pages to rebuild.

  1. npm run bundle
  2. cp vr/reactvrinit.js vr/build/reactvrinit.js
  3. cp vr/index.html vr/build/index.html
  4. cp vr/styles.css vr/styles.css

After copying everything over, look up the references in each file and make sure they are rationalized. The folder structure in development is likely to be quite different from the vr/build setup!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment