We have the `scripts/{code,docs}.angularjs.org-firebase/` directories,
which contain the necessary code and config for deploying built files to
the `code-angularjs-org` and `docs-angularjs-org` Firebase projects
respectively.
Previously, some of the files that needed to be deployed to Firebase (or
Google Cloud) were placed outside these directories (e.g. in
`deploy/{code,docs}/`).
Since these files are only used for deploying to Firebase/Google Cloud,
this commit changes the deployment process to instead copy the files
inside the directories. In a subsequent commit, this will allow
simplifying the deployment process, by running it from inside each
directory instead of having to copy the `firebase.json` files to the
repository root (and adjust the paths).
These are the destination directory changes:
| Before | After |
|--------------|---------------------------------------------|
| deploy/code/ | scripts/code.angularjs.org-firebase/deploy/ |
| deploy/docs/ | scripts/docs.angularjs.org-firebase/deploy/ |
1.2 KiB
Firebase for docs.angularjs.org
This folder contains the Google Firebase scripts for the docs.angularjs.org setup.
See /scripts/code.angularjs.org-firebase/readme.firebase.code.md for the Firebase deployment to code.angularjs.org.
Continuous integration
The docs are deployed to Google Firebase hosting via a CI deployment config, which expects firebase.json to be in the repository root, which is done by a Grunt task (firebaseDocsJsonForCI which is included in prepareDeploy).
The firebaseDocsJsonForCI task modifies the paths in the firebase.json and copies it to the repository root.
See .circleci/config.yml for the complete deployment config and build steps.
Serving locally:
-
Run
yarn grunt package. This builds the files that will be deployed. -
Run
yarn grunt prepareDeploy. This copies docs content files into./deployand the partials for Search Engine AJAX Crawling into./functions/content. It also moves thefirebase.jsonfile to the root folder, where the firebase-cli expects it. -
Run
firebase serve --only functions,hostingCreates a server at http://localhost:5000 that serves from./deployand uses the local function.