Skip to content

Commit

Permalink
Merge pull request #2342 from responsible-ai-collaborative/staging
Browse files Browse the repository at this point in the history
Deploy to Production
  • Loading branch information
kepae authored Oct 23, 2023
2 parents 0c0ec74 + 969036d commit 9c6c67c
Show file tree
Hide file tree
Showing 84 changed files with 3,855 additions and 2,459 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/realm-empty-env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Realm Deploy to Empty Environment

on:
push:
branches:
- staging
workflow_dispatch:

jobs:
push:
runs-on: ubuntu-latest
environment: empty
steps:
- uses: actions/checkout@v2
- name: "Install the Realm CLI"
run: |
npm install -g mongodb-realm-cli
- name: Login
run: |
realm-cli login --api-key="${{ secrets.REALM_API_PUBLIC_KEY }}" --private-api-key="${{ secrets.REALM_API_PRIVATE_KEY }}" --realm-url https://realm.mongodb.com --atlas-url https://cloud.mongodb.com
- name: Push
run: |
cd site/realm
realm-cli push --remote="${{ secrets.GATSBY_REALM_APP_ID }}" -y
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,13 @@ GATSBY_AVAILABLE_LANGUAGES=en,es,fr
SKIP_PAGE_CREATOR=createTsneVisualizationPage
GATSBY_PRISMIC_REPO_NAME=
PRISMIC_ACCESS_TOKEN=
IS_EMPTY_ENVIRONMENT=
```

For `GATSBY_PRISMIC_REPO_NAME` and `PRISMIC_ACCESS_TOKEN` variables, please [follow prismic setup below](https://github.com/responsible-ai-collaborative/aiid#prismic-setup)

For complete empty environment (no database data, no Algolia index, no Prismic content), set `IS_EMPTY_ENVIRONMENT=true`. This will disable all tests that require data.

This will give you access to our `staging` environment, so please be sure you are on the `staging` branch.

In the same folder, install dependencies using `npm` (do not use `yarn`, it will ignore the `package-lock.json` file):
Expand Down Expand Up @@ -183,6 +186,7 @@ If the feature you are working on includes structural changes to the MongoDB dat
- Choose "Username and Password" as authentication method.
- Choose "My Local Environment" as network access and add your current IP address. If your IP is dynamic, add `0.0.0.0` to the list of IP addresses.
- Create a new Realm App. The name should be `AIIDStitch2`. Realm will give it an id like `aiidstitch2-<REALM_APP_ID>`
- Once created, go to `App Settings` and update app region to `Global`
- Create a new database user with admin access and another user with read-only permissions

#### Replicating the Database
Expand Down Expand Up @@ -336,7 +340,16 @@ This project uses Prismic to fetch page content. You can still run the project w

#### Adding the Prismic content types

Follow instructions on [prismicCustomTypes.md](prismicCustomTypes.md)
## Prismic Custom Types
You can find the list of all custom types in the folder custom_types

## How to create a new Custom Type
1. From the prismic left menu click `Custom Types`
2. Click `Create new custom type`
3. Give it a name (name of the json in custom_types folder)
4. Click `JSON editor`
5. Paste the JSON content from the predefined custom types inside the json
6. Click `Save`

#### Adding Prismic documents

Expand Down Expand Up @@ -439,6 +452,8 @@ REALM_API_PRIVATE_KEY=
REALM_API_PUBLIC_KEY=
```

To get your Public and Private API Key, follow these [instructions](https://www.mongodb.com/docs/atlas/configure-api-access/#std-label-create-org-api-key).

### Testing

For integration testing, we use Cypress. You can run the desktop app continuously as part of your development environment or run it on demand in headless mode.
Expand Down Expand Up @@ -709,8 +724,8 @@ To disable all email noticications, fill the following `SendGridApiKey` secret v
SendGridApiKey = [SendGrid API key from https://app.sendgrid.com/settings/api_keys]
publicApiKey = [Public API key from the Atlas Organization. See comment below for more information]
privateApiKey = [Private API key from the Atlas Organization. See comment below for more information]
groupId = [Atlas Service App group ID, ie: "62cc90978bc4600cafdcf16e"]
appId = [Atlas Service App ID, ie: "62cc98647e6a26c53d5b4b53"]
groupId = [Atlas Service App group ID, eg: "62cc90978bc4600cafdcf16e"]
appId = [Atlas Service App ID, eg: "62cc98647e6a26c53d5b4b53"]
```
To get your Public and Private API Key, follow these [instructions](https://www.mongodb.com/docs/atlas/configure-api-access/#std-label-create-org-api-key).
Expand Down
268 changes: 0 additions & 268 deletions prismicCustomTypes.md

This file was deleted.

4 changes: 4 additions & 0 deletions site/gatsby-site/cypress/e2e/incidentVariants.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ const new_submitter = 'New Submitter';
describe('Variants pages', () => {
const url = `/cite/${incidentId}`;

before('before', function () {
Cypress.env('isEmptyEnvironment') && this.skip();
});

it('Successfully loads', () => {
cy.visit(url);

Expand Down
4 changes: 4 additions & 0 deletions site/gatsby-site/cypress/e2e/integration/account.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import { maybeIt } from '../../support/utils';
describe('Account', () => {
const url = '/account';

before('before', function () {
Cypress.env('isEmptyEnvironment') && this.skip();
});

it('Should successfully load account page', () => {
cy.visit(url);
});
Expand Down
Loading

0 comments on commit 9c6c67c

Please sign in to comment.