Skip to content

Commit

Permalink
Update site with latest version and nearform links (#2728)
Browse files Browse the repository at this point in the history
  • Loading branch information
carbonrobot authored Jan 19, 2024
1 parent 1da45d3 commit 0d848e6
Show file tree
Hide file tree
Showing 3 changed files with 300 additions and 284 deletions.
58 changes: 5 additions & 53 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<h1 align="center">Victory Documentation Site</h1>

[Documentation site](https://formidable.com/open-source/victory/) for [victory](https://github.com/FormidableLabs/victory) built with [react-static](https://github.com/nozzle/react-static), and deployed with [formideploy](https://github.com/FormidableLabs/formideploy)
[Documentation site](https://formidable.com/open-source/victory/) for [victory](https://github.com/FormidableLabs/victory) built with [react-static](https://github.com/nozzle/react-static).


## Getting Started
Expand All @@ -25,62 +25,14 @@ Once it builds successfully, serve it:
```bash
yarn serve
```
The staging and production sites are served from a nested path, e.g. `https://formidable.com/open-source/victory`. This step is important for validating that both the `basePath` used by the static HTML output and the `basename` used by the client-side router are working as expected.
The staging and production sites are served from a nested path, e.g. `https://commerce.nearform.com/open-source/victory`. This step is important for validating that both the `basePath` used by the static HTML output and the `basename` used by the client-side router are working as expected.

## Deployment

### Staging

_Only for project administrators._

Our CI deploys to staging for each PR using surge.sh at the following URL:

`https://formidable-com-victory-staging-${PR_NUMBER}.surge.sh/open-source/victory`

To test things out locally find the `Surge.sh` entry in 1password in the IC vault and make up some pretend values for a PR number in `FORMIDEPLOY_PULL_REQUEST`:

```sh
$ cd docs
$ yarn clean && \
yarn build
$ SURGE_LOGIN=<SNIPPED> \
SURGE_TOKEN=<SNIPPED> \
FORMIDEPLOY_PULL_REQUEST=12 \
yarn deploy:stage
```

### Production

_Only for project administrators._

Our CI is configured to deploy the production build in `dist` to `formidable.com/open-source/victory`. This will happen automatically when a branch with docs changes that was opened by an internal collaborator is merged into the `main` branch of this repo. This section discusses kicking the tires locally:

First, install the AWS CLI:

```sh
$ brew install awscli
```

Then, set up `aws-vault` with the AWS access and secret keys for "CI" in the `AWS IAM (victory-ci)` entry in the IC vault:

```sh
$ brew cask install aws-vault
$ aws-vault add fmd-victory-ci
# Enter AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY values.
```

_note_ if these keys do not already exist in the IC vault, they will need to be created. Please reach out to a member of the cloud team for help.

Then build for production and deploy with dry run to check things:

```sh
$ cd docs
$ yarn clean && \
yarn build
$ aws-vault exec fmd-victory-ci --no-session -- \
yarn deploy:prod --dryrun
```
This site is deployed with Vercel infrastructure and is automated with a repository trigger in the Formidable Labs Vercel account.

### Notes
The site is directly accessible at [https://victory-rose.vercel.app/open-source/victory](https://victory-rose.vercel.app/open-source/victory).

Docs PRs that originate from forks will not trigger staging or production builds of the docs site. To trigger a docs update based on a forked PR, someone with write access to the repo should open a new PR based on the changes and close the original with a reference. [Here's a handy git alias for creating a new branch based on a pr](https://gist.github.com/gvaughn/f3c7897a51e52138eac1)
The `commerce.nearform.com` site uses a rewrite to host it under the path [https://commerce.nearform.com/open-source/victory/](https://commerce.nearform.com/open-source/victory/).
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"styled-components": "^5.1.0",
"styled-normalize": "^8.0.6",
"unist-util-visit": "^1.4.0",
"victory": "^36.4.0"
"victory": "^36.8.2"
},
"devDependencies": {
"babel-cli": "^6.26.0",
Expand Down
Loading

1 comment on commit 0d848e6

@vercel
Copy link

@vercel vercel bot commented on 0d848e6 Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.