Przeglądaj źródła

Web deploy to gh-pages barnch

Lutz Roeder 5 lat temu
rodzic
commit
fa233c1f9b
2 zmienionych plików z 9 dodań i 6 usunięć
  1. 6 6
      Makefile
  2. 3 0
      source/index.js

+ 6 - 6
Makefile

@@ -84,12 +84,12 @@ build_web:
 	sed -i "s/0\.0\.0/$$(grep '"version":' package.json -m1 | cut -d\" -f4)/g" ./dist/web/index.html
 
 publish_web: build_web
-	rm -rf ./dist/release
-	git clone --depth=1 https://x-access-token:$(GITHUB_TOKEN)@github.com/$(GITHUB_USER)/netron.git --branch release ./dist/release 2>&1 > /dev/null
-	cp -R ./dist/web/* ./dist/release
-	git -C ./dist/release add --all
-	git -C ./dist/release commit --amend --no-edit
-	git -C ./dist/release push --force origin release
+	rm -rf ./dist/gh-pages
+	git clone --depth=1 https://x-access-token:$(GITHUB_TOKEN)@github.com/$(GITHUB_USER)/netron.git --branch gh-pages ./dist/gh-pages 2>&1 > /dev/null
+	cp -R ./dist/web/* ./dist/gh-pages
+	git -C ./dist/gh-pages add --all
+	git -C ./dist/gh-pages commit --amend --no-edit
+	git -C ./dist/gh-pages push --force origin gh-pages
 
 publish_cask:
 	curl -s -H "Authorization: token $(GITHUB_TOKEN)" https://api.github.com/repos/Homebrew/homebrew-cask/forks -d '' 2>&1 > /dev/null

+ 3 - 0
source/index.js

@@ -7,6 +7,9 @@ var host = {};
 host.BrowserHost = class {
 
     constructor() {
+        if (window.location.hostname.endsWith('.github.io')) {
+            window.location.replace('https://netron.app');
+        }
         window.eval = () => {
             throw new Error('window.eval() not supported.');
         };