Skip to content

Commit

Permalink
docs(build): deploy docs to firebase on publish (ReactiveX#3881)
Browse files Browse the repository at this point in the history
  • Loading branch information
niklas-wortmann authored and benlesh committed Jul 3, 2018
1 parent 1a9b13e commit eb42a60
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs_app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"aio-use-npm": "node tools/ng-packages-installer restore .",
"aio-check-local": "node tools/ng-packages-installer check .",
"ng": "ng",
"firebase": "firebase",
"start": "ng serve --aot",
"prebuild": "npm run setup",
"build": "npm run ~~build",
Expand Down
22 changes: 22 additions & 0 deletions docs_app/scripts/publish-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

readonly projectId=rxjs-dev
readonly deployedUrl=https://rxjs-dev.firebaseapp.com
readonly firebaseToken=$FIREBASE_TOKEN

# Deploy
(
cd "`dirname $0`/.."

# Build the app
npm run build --env=stable

# Include any mode-specific files
cp -rf src/extra-files/$deployEnv/. dist/

# Deploy to Firebase
npm run firebase -- login
npm run firebase -- use "$projectId"
npm run firebase -- deploy --message "Deploy docs automatically" --non-interactive
npm run firebase -- logout
)
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
"perf:protractor": "echo \"Protractor is not working currently\" && exit -1 && protractor protractor.conf.js",
"perf:micro": "node ./perf/micro/index.js",
"prepublish": "shx rm -rf ./typings && npm run build_all",
"postpublish": "./docs_app/scripts/publish-docs.sh",
"publish_docs": "./publish_docs.sh",
"test": "cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha --opts spec/support/default.opts \"spec/**/*-spec.ts\"",
"test_transpile_only": "cross-env TS_NODE_PROJECT=spec/tsconfig.json TS_NODE_TRANSPILE_ONLY=true mocha --opts spec/support/default.opts \"spec/**/*-spec.ts\"",
Expand Down

0 comments on commit eb42a60

Please sign in to comment.