Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy docs #2865

Draft
wants to merge 20 commits into
base: next
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions sites/docs/pages/deployment/aws-amplify/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
sidebar_position: 4
title: AWS Amplify
breadcrumb: "select 'AWS Amplify' as breadcrumb"
description: Deploy Evidence to AWS Amplify
og:
image: /img/deployment/deploy-aws-amplify.png
---

[AWS Amplify](https://aws.amazon.com/amplify/) is an AWS service that allows you to create full stack web and mobile apps. Amplify can be used to deploy Evidence apps from a Git repository.

## Prerequisites

- An AWS account
- An Evidence project pushed to a Git service like GitHub, GitLab, or Bitbucket.

## Deploy your app

1. Login to the <a href="https://console.aws.amazon.com/" target="_blank" class="markdown">AWS Console</a>
2. Navigate to AWS Amplify, and select **Deploy an app** / **Create new app**
3. **Choose source code provider**
- Select your source code provider (GitHub, Bitbucket, CodeCommit, GitLab).
- Click **Next**.
- Install and authorize the Amplify app on your repository via your Git provider.
4. **Add repository and branch**
- Use the search box to find the repository containing your Evidence project.
- Select the branch you want to deploy,
- (Optionally select the folder containing your Evidence project if using a monorepo).
- Click **Next**.
5. **App settings**
- Edit the frontend build command:
```code
npm run sources && npm run build
```
- Edit the build output directory: `build`
- Open the **Advanced settings** section
- Build image: `Custom build image`
- Reference: `public.ecr.aws/docker/library/node:20-bookworm`
- Click to add new **Environment variables**
- Copy your environment variables from the Evidence settings page: <a href="http://localhost:3000/settings/#deploy" target="_blank" class="markdown">http://localhost:3000/settings/#deploy</a>
- Alternatively, you can find credentials in `connection.options.yaml` files in your `/sources/your_source` directory. The key format used should be `EVIDENCE_SOURCE__[your_source]__[option_name]` (Note the casing matches your source names, and the double underscores). Note that the values are base64 encoded, and will need to be decoded.
- Click **Next**
6. **Review**
- Review your settings and click **Save and deploy**

Your app will be deployed to https://[branch-name]-[app-id].amplifyapp.com

## Domains, Authentication and Scheduling

{@partial "evidence-cloud.md"}

### Authentication

Your deployed app will be public by default.

#### Global password

It is possible to set a global site password using AWS Amplify from the console:

Hosting > Access control > Manage access.

#### Cognito

It is also possible to set up auth via [Cognito](https://docs.amplify.aws/react/build-a-backend/auth/).

### Custom domains

Your app will be deployed to https://[branch-name]-[app-id].amplifyapp.com

You can set a custom domain using AWS Amplify from the console:

Hosting > Custom domains > Add domain.

### Data refresh

You can manually refresh your data using AWS Amplify from the console:

[your-app] > Deployments > Redeploy this version.
91 changes: 91 additions & 0 deletions sites/docs/pages/deployment/azure-static-apps/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---
sidebar_position: 4
title: Azure Static Apps
description: Deploy Evidence to Azure Static Apps
og:
image: /img/deployment/deploy-azure-static-apps.png
---

[Azure Static Apps](https://learn.microsoft.com/en-us/azure/static-web-apps/) is a Microsoft Azure service that allows you to deploy static websites and web apps to Azure. Azure Static Apps can be used to deploy Evidence from a Git repository.

## Prerequisites

- A Microsoft Azure account
- An Evidence project pushed to a Git service like GitHub or Azure DevOps

## Deploy your app

1. In the <a href="https://portal.azure.com/" target="_blank" class="markdown">Azure Portal</a>, select **Create a Resource** and choose **Static Web App**
1. Basics
- Choose a subscription, and resource group for the app
- Choose a name for the app
- Choose a plan type: Free, Standard or Dedicated
- Choose a source code provider: GitHub, Azure DevOps or Other
- Authenticate with your Git provider
- Choose a repository, and branch to deploy from
- Build presets: `Custom`
- Output location `/build`
1. Deployment configuration
- Choose either a deployment token, or (recommended) GitHub to deploy your code
1. Advanced and Tags: No changes needed
1. Review and create: Click Create
1. This will create add a new workflow file in your repository, e.g. `.github/workflows/azure-static-web-apps-thankful-hill-01fbff51e.yml`
1. Add secrets to your GitHub repo: Settings > Secrets and variables > Actions
- With your Evidence dev server running, go to the <a href=http://localhost:3000/settings#deploy target="_blank" class="markdown">settings page</a> and copy each of the environment variables into the GitHub secrets
- Alternatively, you can find credentials in `connection.options.yaml` files in your `/sources/your_source` directory. The key format used should be `EVIDENCE_SOURCE__[your_source]__[option_name]` (Note the casing matches your source names, and the double underscores). Note that the values are base64 encoded, and will need to be decoded.
1. In your git repo, edit this file's "Build and Deploy" step, adding `app_build_command: "npm run sources && npm run build"`, and environment variables to reference the secrets
```yaml
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
...
# Add this line
app_build_command: "npm run sources && npm run build"
###### End of Repository/Build Configurations ######
env:
# Add and uncomment your environment variables here
# Note that GitHub capitalizes the names of secrets, but Evidence requires the casing to match your source and option names
# EVIDENCE_SOURCE__my_source__username: ${{ secrets.EVIDENCE_SOURCE__MY_SOURCE__USERNAME }}
# EVIDENCE_SOURCE__my_source__private_key: ${{ secrets.EVIDENCE_SOURCE__MY_SOURCE__PRIVATE_KEY }}
```
1. Commit and push this change, and your app will deploy.

Your app will be available at `https://[random-word-12345].azurestaticapps.net`

## Domains, Authentication and Scheduling

{@partial "evidence-cloud.md"}

### Authentication

You can add a global site password to your app:

[your-app] > Settings > Configuration > Password protection > Protect both staging and production environments

You can also configure other authentication providers, such as Microsoft Entra ID, or GitHub. See the [official docs](https://learn.microsoft.com/en-us/azure/static-web-apps/authentication-authorization#set-up-sign-in) for more information.

### Custom Domains

You can add a custom domain to your Azure Static App as follows:

[your-app] > Settings > Custom domains > Add > Custom domain on other DNS

### Data Refresh

To add a deployment schedule, modify the workflow file in your repository, adding a `schedule` trigger.

```yaml
on:
push:
branches: 'main'
schedule:
- cron: '0 0 * * *' # This is midnight every day
```

Also delete the `if` line from the `build_and_deploy_job` step:

```yaml
build_and_deploy_job:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') # delete this line
```
52 changes: 52 additions & 0 deletions sites/docs/pages/deployment/cloudflare-pages/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
sidebar_position: 4
title: Cloudflare Pages
description: Deploy Evidence to Cloudflare Pages
og:
image: /img/deployment/deploy-cloudflare-pages.png
---

Cloudflare is a popular CDN and DNS provider that also offers a static site hosting service called [Cloudflare Pages](https://pages.cloudflare.com/). Cloudflare Pages can be used to deploy Evidence from a Git repository.

## Prerequisites

- A Cloudflare account
- An Evidence project pushed to a Git service like GitHub or GitLab

## Deploy your app

1. Navigate to the <a href="https://dash.cloudflare.com/" target="_blank" class="markdown">Cloudflare dashboard</a>
1. Select **Workers & Pages** from the left-hand menu, and select **Create**
1. There are two tabs: **Workers** and **Pages** - choose **Pages**
1. Select **Connect to Git**, and choose GitHub or GitLab
1. Select Repository
- Authenticate with your Git provider
- Choose the repository to deploy from
- You may need to configure repository access permissions
1. Set up builds and deployments
- Choose a production branch
- Set the build command: `npm run sources && npm run build`
- Set the build output directory: `/build`
1. (Optionally select the root path containing your Evidence project if using a monorepo)
1. Add environment variables
- Click **Add variable**
- With your Evidence dev server running, go to the <a href=http://localhost:3000/settings#deploy target="_blank" class="markdown">settings page</a> and copy each of the environment variables
- Paste them into the Cloudflare Pages environment variables section
1. Click **Save and Deploy**

Your app will be deployed to a URL like `https://[repo-name].pages.dev`. It can take a few minutes for the site to be available after deployment.

## Domains, Authentication and Scheduling

{@partial "evidence-cloud.md"}

### Authentication

By default, your app will be public.

Authentication can be configured with [Cloudflare Access](https://developers.cloudflare.com/cloudflare-one/identity/access/).

Workers & Pages > [Your app] > Settings > General > Access Policy > Manage

You will need to set up access groups and policies to control access to your app. A one time PIN code can be configured for user login.

63 changes: 41 additions & 22 deletions sites/docs/pages/deployment/evidence-cloud/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,63 @@
sidebar_position: 2
hide_table_of_contents: false
title: Evidence Cloud
description: Evidence Cloud is a hosting service that allows you to securely host Evidence apps. It's the easiest way to host an Evidence app, without having to worry about maintaining your own infrastructure.
description: Evidence Cloud is the easiest way to host Evidence apps. It's maintained by the Evidence team, and allows you to securely host Evidence apps without having to worry about maintaining your own infrastructure.
og:
image: /img/deployment/deploy-evidence-cloud.png
---

## What is Evidence Cloud?

Evidence Cloud is our hosting service that allows you to securely host Evidence apps.

It's the easiest way to host an Evidence app, without having to worry about maintaining your own infrastructure.

### Key Features
Evidence Cloud is the easiest way to host Evidence apps. It's maintained by the Evidence team, and allows you to securely host Evidence apps without having to worry about maintaining your own infrastructure.

- **Easy to set up:** Deploy in 5 minutes without configuring any infrastructure.
- **Secure:** Manage access for users in your team.
- **Organizational domain:** Host your app at `[organisation].evidence.app`.
- **Scheduled refreshes:** Daily (or more frequent) data updates to your app.
- **Re-build on push:** Merge to your target branch to rebuild your app.
- **Custom domains:** Add a custom domain to your app.
- **Cloud execution engine:** Offload heavy queries to our Cloud SQL engine for faster performance.

## Sign Up
## Prerequisites

Evidence Cloud is now generally available. You can sign up below.
- A GitHub account
- An Evidence project pushed to GitHub (optional)

<LinkButton url="https://evidence.app"> Sign Up </LinkButton>
## Deploying your app

<br/>
<br/>
1. Go to <a href="https://evidence.app" target="_blank" class="markdown">Evidence Cloud</a> and login with GitHub
1. Choose an option to get started:
1. **If you have an existing Evidence project:** click `Add Project`
1. **If you don't have a Evidence project yet:** select `Start from our templates`, and choose evidence-dev/template.
1. Deploy your project
- Repository: Choose the GitHub repository containing your Evidence project
- Branch: Edit if required
- Domain: Choose the subdomain you want to deploy to
- (Optional) Root directory: Edit to point to your Evidence directory if you are using a monorepo
- Authentication: None, Email and Password (Paid plans only), or SSO (Paid plans only)
1. Set your environment variables
- **If you are deploying an existing project**, click "Paste Environment Variables"
- Navigate to the <a href=http://localhost:3000/settings#deploy target="_blank" class="markdown">settings page</a> and use the **Copy All** button to copy them to your clipboard, then paste them into the Environment Variables section. Click **Save**.
- Alternatively, you can find credentials in `connection.options.yaml` files in your `/sources/your_source` directory, and enter them in KEY=VALUE format on separate lines.
- The key format used should be `EVIDENCE_SOURCE__[your_source]__[option_name]` (Note the casing matches your source names, and the double underscores). Note that the values are base64 encoded, and will need to be decoded.
- **If you are deploying from a template**, click "Use Template Environment Variables"
1. Click `Deploy your project`

## How do I set up Evidence Cloud
Your app will be deployed to https://[your-subdomain].evidence.app

Setting up Evidence Cloud takes less than 5 minutes.
## Domains, Authentication and Scheduling

1. Go to [evidence.app](https://evidence.app) and sign in with GitHub
1. Choose an option to get started:
1. **If you have an existing app:** click `Deploy Evidence Project`
1. **If you don't have a app yet**, select `Create New Project from Template`, then return to [evidence.app](https://evidence.app) after creating your template app in GitHub
1. Enter your deployment details, including the GitHub repo you want to use, and the domain you want to deploy it to
1. Add your credentials, either from your local app or from the template
1. Click `Deploy your project`
### Authentication

Evidence Cloud Team and Enterprise plans support private apps with auth. If you need to configure an SSO provider, reach out to our team on [Slack](https://slack.evidence.dev).

### Custom Domains

Evidence Cloud Enterprise plans support custom domains. Reach out to our team on [Slack](https://slack.evidence.dev) to set your domain up.

### Data Refresh

To adjust your deployment schedule, select your app in [Evidence Cloud](https://evidence.app), click **Schedule**, and adjust the schedule.

Community Plan sites can be refreshed daily. More frequent refreshes are available on the Team and Enterprise plans.

## Frequently Asked Questions

Expand Down
Loading