mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-12-22 23:30:35 +08:00
Setup website with docusaurus (#11)
Summary: Set up landing page, docs page, and html versions of the ipython notebook tutorials. Pull Request resolved: https://github.com/fairinternal/pytorch3d/pull/11 Reviewed By: gkioxari Differential Revision: D19730380 Pulled By: nikhilaravi fbshipit-source-id: 5df8d3f2ac2f8dce4d51f5d14fc336508c2fd0ea
This commit is contained in:
committed by
Facebook Github Bot
parent
e290f87ca9
commit
15d3a4557e
46
scripts/publish_website.sh
Normal file
46
scripts/publish_website.sh
Normal file
@@ -0,0 +1,46 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
|
||||
usage() {
|
||||
echo "Usage: $0 [-b]"
|
||||
echo ""
|
||||
echo "Build and push updated PyTorch3D site."
|
||||
echo ""
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Current directory (needed for cleanup later)
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
# Make temporary directory
|
||||
WORK_DIR=$(mktemp -d)
|
||||
cd "${WORK_DIR}" || exit
|
||||
|
||||
# Clone both master & gh-pages branches
|
||||
git clone git@github.com:facebookresearch/pytorch3d.git pytorch3d-master
|
||||
git clone --branch gh-pages git@github.com:facebookresearch/pytorch3d.git pytorch3d-gh-pages
|
||||
|
||||
cd pytorch3d-master/website || exit
|
||||
|
||||
# Build site, tagged with "latest" version; baseUrl set to /versions/latest/
|
||||
yarn
|
||||
|
||||
cd .. || exit
|
||||
./scripts/build_website.sh -b
|
||||
|
||||
yarn run build
|
||||
|
||||
cd "${WORK_DIR}" || exit
|
||||
rm -rf pytorch3d-gh-pages/*
|
||||
touch pytorch3d-gh-pages/CNAME
|
||||
echo "pytorch3d.org" > pytorch3d-gh-pages/CNAME
|
||||
mv pytorch3d-master/website/build/pytorch3d/* pytorch3d-gh-pages/
|
||||
|
||||
cd pytorch3d-gh-pages || exit
|
||||
git add .
|
||||
git commit -m 'Update latest version of site'
|
||||
git push
|
||||
|
||||
# Clean up
|
||||
cd "${SCRIPT_DIR}" || exit
|
||||
rm -rf "${WORK_DIR}"
|
||||
Reference in New Issue
Block a user