This repository was archived by the owner on Aug 15, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +37
-11
lines changed
Expand file tree Collapse file tree 2 files changed +37
-11
lines changed Original file line number Diff line number Diff line change 1313# See the License for the specific language governing permissions and
1414# limitations under the License.
1515# =============================================================================
16+
17+ # Builds the website and stages it for preview on localhost:4000. If all is good
18+ # run ./script/publish-website.sh to deploy it to https://deeplearnjs.org.
19+
1620TMP_DIR=" /tmp/deeplearn-website"
1721
1822npm run prep
@@ -49,14 +53,6 @@ cp -r demos/homepage/* "$TMP_DIR"
4953cp " README.md" " $TMP_DIR /_includes/"
5054rm " $TMP_DIR " /index.ts
5155
52- git stash
53- git checkout gh-pages
54-
55- cp -rf " $TMP_DIR " /* .
56-
57- git add .
58- git commit -m " github pages"
59-
60- git checkout master
61- rm -f -r " _site/"
62- git stash pop
56+ echo " Website staged at $TMP_DIR "
57+ pushd $TMP_DIR > /dev/null
58+ bundle exec jekyll serve
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ # Copyright 2017 Google Inc. All Rights Reserved.
3+ #
4+ # Licensed under the Apache License, Version 2.0 (the "License");
5+ # you may not use this file except in compliance with the License.
6+ # You may obtain a copy of the License at
7+ #
8+ # http://www.apache.org/licenses/LICENSE-2.0
9+ #
10+ # Unless required by applicable law or agreed to in writing, software
11+ # distributed under the License is distributed on an "AS IS" BASIS,
12+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ # See the License for the specific language governing permissions and
14+ # limitations under the License.
15+ # =============================================================================
16+
17+ # Deploys the staged website to https://deeplearnjs.org.
18+ # Before running this script, run ./scripts/make-website.sh which stages the
19+ # website and serves it on localhost:4000 for preview.
20+
21+ TMP_DIR=" /tmp/deeplearn-website"
22+ pushd $TMP_DIR > /dev/null
23+ bundle exec jekyll build
24+ pushd $TMP_DIR /_site > /dev/null
25+ gsutil -m rsync -d -r . gs://deeplearnjs.org
26+ gsutil -m setmeta -h " Cache-Control:private" " gs://deeplearnjs.org/**.html"
27+ gsutil -m setmeta -h " Cache-Control:private" " gs://deeplearnjs.org/**.css"
28+ gsutil -m setmeta -h " Cache-Control:private" " gs://deeplearnjs.org/**.js"
29+ popd > /dev/null
30+ popd > /dev/null
You can’t perform that action at this time.
0 commit comments