# \[WIP] Deploying your Plugin

{% hint style="info" %}
This page is not yet complete, and it only contains a general outline of the deployment process. Thank you for your patience as the page is expanded with more details.
{% endhint %}

This page details the recommended way to deploy your Ango Hub Plugin to the cloud.

## Deployment Example

For an example deployment, see [this GitHub repository](https://github.com/imerit-io/plugin-rest-example). It contains everything you need to know to get started:&#x20;

{% @github-files/github-code-block %}

## Plugin Prerequisites

Your plugin's *Connector* field must be set to REST.

<figure><img src="https://3895963154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTcOUG6rfWxqGM0N4db2P%2Fuploads%2FKY9HsQ8b99EgWxkxFHRU%2Fimage.png?alt=media&#x26;token=d2677872-a8e3-4879-a8dd-e4b9f4bfa0a4" alt="" width="563"><figcaption></figcaption></figure>

## Deploying to Google Cloud Run

### Google Cloud Platform Prerequisites

* Enable the Cloud Run API and the Artifact Registry API on GCP.
* Configure Workload Identity Federation for GitHub.
* Grant the following IAM permissions:
  * Cloud Run Admin
  * IAM Service Account User
  * Artifact Registry Admin
* Ensure you have this env variable set this way:

`CONNECTOR=REST`

### Steps

#### 1. Configure GitHub Actions

Once you have created your repository containing the plugin files, this file (`.github/workflows/cloudrun-docket.yml`) automates the deployment to Google Cloud Run. Replace `PROJECT_ID`, `REPOSITORY`, and `REGION` with your GCP project details.

#### 2. Triggering Deployment

Whenever you push changes to the `main` branch, deployment is triggered.

## Deploying to AWS App Runner

### AWS Prerequisites

* Ensure IAM roles are configured for GitHub Actions
* Create an Amazon ECR repository named `ango-plugins`
* The sample file [cloudrun-docker.yml](https://github.com/imerit-io/plugin-rest-example/blob/main/.github%2Fworkflows%2Fcloudrun-docker.yml) is a reference on how to set up your variables – please consult it and create your cloudrun-docket.yml file accordingly.
* Set the necessary AWS permissions. This can be done by following the actions specified in these two pages:
  * <https://aws.amazon.com/blogs/security/use-iam-roles-to-connect-github-actions-to-actions-in-aws/>
  * <https://aws.amazon.com/blogs/containers/deploy-applications-in-aws-app-runner-with-github-actions/>

### Steps

* The `.github/workflows/deploy-aws-apprunner.yml` file in the [sample repo](https://github.com/imerit-io/plugin-rest-example) automates the deployment to AWS App Runner. Ensure you replace `AWS_REGION`, `ECR_REPOSITORY`, and `SERVICE` with your own AWS details.
* As with GCP, deployment to AWS App Runner is triggered by pushing changes to the `main` branch or manually via GitHub Actions.
