docs/docs/cloud-ci-cd/one-click-deploy/index.mdx
import Thumbnail from '@site/src/components/Thumbnail'; import ProductBadge from '@site/src/components/ProductBadge';
One Click Deploy to Hasura Cloud enables you to instantly deploy a Hasura application from a public GitHub repository to Hasura Cloud. This feature can be used to share Hasura applications with Metadata, Migrations and Seeds with anyone and they can try them out instantly on Hasura Cloud.
:::info Try it out
:::
On initiating a One Click Deploy to Hasura Cloud workflow a new Hasura Cloud Project is spun up for you, the source repository is cloned and Migrations, Metadata and seeds from it are applied to the created Hasura Cloud Project. You will then be able to try out queries from the Hasura Console of the project. Environment variables, such as database connection strings, required for the app to be set up are requested during the project setup workflow.
See the detailed steps in the workflow below:
Click a Deploy to Hasura Cloud button or navigate to a One Click Deploy URL to initiate a One Click Deploy to Hasura
Cloud workflow.
A One Click Deploy to Hasura Cloud URL follows the following format:
https://cloud.hasura.io/deploy?github_repo=<github-repo-link
>&hasura_dir=<hasura-dir-path>&branch=<branch-name></branch-name></hasura-dir-path
></github-repo-link>
https://cloud.hasura.io/deploygithub_repo: URL of the GitHub repository containing the Hasura assets e.g. https://github.com/hasura/data-hubhasura_dir: Path to the directory in the repository containing the Hasura assets e.g.
data-models/postgres/ecommerce/hasurabranch: (optional) Branch in the repository from which the assets are picked. If not provided, the default
branch of the repository is used.The One Click Deploy URL is typically linked to a Deploy to Hasura Cloud button shown below which can be clicked to
initiate a One Click Deploy workflow:
Once you initiate the deployment workflow, we'll auto-generate a new Hasura Cloud Project for the deployment of your app.
<Thumbnail src="/img/deployment/one-click-to-deploy/project_loading.png" alt="Initializing Hasura Cloud Project" width="600px" />
Once the Project is created, you will be redirected to the Project's Console for the next steps.
Next, we clone the Hasura assets, i.e. Metadata, Migrations and seeds, from the source GitHub repository to be applied on your Project.
<Thumbnail src="/img/deployment/one-click-to-deploy/cloning_assets.png" alt="Clone assets" width="800px" />If the app you're deploying requires environment variables, like database connection strings, we'll prompt you to enter those before the assets can be applied
<Thumbnail src="/img/deployment/one-click-to-deploy/user_env.png" alt="Setting env vars" width="800px" />If the app requires a Postgres database, you can create and connect to a free new Neon Postgres database by clicking
Create New Database. You can also connect an existing database by clicking Connect Existing Database.
After populating the environment variables as required, click on Set Environment Variables to proceed.
Next, the Hasura assets, i.e. Metadata, Migrations and seeds, are applied on your Project to complete the application setup.
<Thumbnail src="/img/deployment/one-click-to-deploy/project_ready.png" alt="Project ready" width="800px" />Your Hasura Cloud App deployment is now complete!
Play around and explore the capabilities of the Hasura GraphQL Engine's pre-generated GraphQL queries. To get started, try running a few queries from the Hasura Console to interact with the data. See more information on GraphQL queries generated by Hasura here.
<Thumbnail src="/img/deployment/one-click-to-deploy/project_console.png" alt="Project console" width="1200px" />Launch console to continue the One Click Deploy workflow.