Skip to content

Commit 5bc30bf

Browse files
authored
[APT-1655] Add google analytics config to deployment scripts (#141)
* Add google analytics config to deployment scripts * Update readme
1 parent 131dbdc commit 5bc30bf

File tree

4 files changed

+33
-20
lines changed

4 files changed

+33
-20
lines changed

README.md

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# Website
1+
# Docs Site
22

33
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern
44
static website generator.
55

6-
### Docs Sourcer
6+
## Docs Sourcer
77

88
All of the content that we see on the docs site is rendered to the top level
99
`docs/` folder by the
@@ -16,24 +16,24 @@ pull in tagged content from other files, located in other GitHub repos, pull in
1616
images and auto-correct links. This will allow content creators to have more
1717
features when authoring content.
1818

19-
### Content creation
19+
## Content creation
2020

2121
All manually created MarkDown source content lives in the `_docs-sources/`
2222
folder. The top level `docs/` folder contains the _generated_ output that
2323
results after the `docs-sourcer` processes the `_docs-sources/` directory.
2424
Grunts should **never edit any of the MarkDown files in the `docs/` folder
2525
directly**. We should always be editing the content in `_docs-sources/`.
2626

27-
### Installation of dependencies
27+
## Installation of dependencies
2828

29-
```
30-
$ yarn
29+
```sh
30+
yarn
3131
```
3232

33-
### Local development
33+
## Local development
3434

35-
```
36-
$ yarn start
35+
```sh
36+
yarn start
3737
```
3838

3939
This command starts a local development server and opens up a browser window.
@@ -43,7 +43,16 @@ you edit a file in `_docs-sources/` then the `docs-sourcer` will automatically
4343
re-run to regenerate the output files. Docusaurus will then hot-reload that
4444
content so that to the end user, they have "live reloading" while authoring.
4545

46-
### Committing changes to docs
46+
### Run production build locally
47+
48+
```sh
49+
yarn build && yarn serve
50+
```
51+
52+
This will create and serve a production build. This can be used to verify the
53+
expected behaviors in a production environment and view the Google analytics.
54+
55+
## Committing changes to docs
4756

4857
While authoring local content, you will exclusively be making your changes in
4958
the `_docs-sources/` folder. The `docs-sourcer` will then pre-process and
@@ -55,22 +64,22 @@ Generated content should be up to date if you are previewing locally while
5564
editing but you may wish to manually regenerate the output (see section below)
5665
to ensure it is totally up to date.
5766

58-
### Manually generating docs output
67+
## Manually generating docs output
5968

6069
It's possible to manually regenerate output content from the sources in
6170
`_docs-sources/`:
6271

63-
```
72+
```sh
6473
yarn regenerate:local
6574
```
6675

6776
This command can be run at any time, regardless of whether `yarn start` is
6877
currently running.
6978

70-
### Build
79+
## Build
7180

72-
```
73-
$ yarn build
81+
```sh
82+
yarn build
7483
```
7584

7685
This command generates static content into the `build` directory and can be

config/default.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ algolia:
44
appId: 7AWZHGNJE2
55
apiKey: f799a6e9a302535bd92bbfab65fb6311 # This is a search only API key. It's safe to check in.
66
indexName: docs_site_dev
7+
8+
googleAnalytics:
9+
trackingID: UA-154792164-3

scripts/push-to-s3-prod.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
set -e
44

55
export CONFIG_SITE_URL="https://docs.gruntwork.io"
6+
7+
export CONFIG_GOOGLE_ANALYTICS_TRACKING_ID="UA-76462621-5"
8+
69
export ALGOLIA_INDEX_NAME="docs_site_prod"
710
export ALGOLIA_API_KEY="49a495ba4c210780a28feed306d05522" # This is a search only key. It is safe to check in.
811

scripts/push-to-s3-stage.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22

33
set -e
44

5-
# Cicle CI sets Google Analytics env variables. We want to unset them for stage
6-
# as they are meant only for prod use. We don't track Google Analytics in stage.
7-
unset CONFIG_GOOGLE_ANALYTICS_TRACKING_ID
8-
unset CONFIG_GOOGLE_ANALYTICS_ANONYMIZE_IP
9-
105
export CONFIG_SITE_URL="https://docs.dogfood-stage.com"
6+
7+
export CONFIG_GOOGLE_ANALYTICS_TRACKING_ID="UA-154792164-2"
8+
119
export ALGOLIA_INDEX_NAME="docs_site_stage"
1210
export ALGOLIA_API_KEY="8487ee2b8a8d59dfd7597854d562a38b" # This is a search only key. It is safe to check in.
1311

0 commit comments

Comments
 (0)