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

Add app deployment guides for Fly.io, Render, and Railway #6983

Merged
merged 7 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
34 changes: 34 additions & 0 deletions docs/guides/cloud/deploy/fly.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.. _ref_guide_cloud_deploy_fly:

======
Fly.io
======

:edb-alt-title: Deploying applications built on EdgeDB Cloud to Fly.io

1. Install the `Fly.io CLI <https://fly.io/docs/hands-on/install-flyctl/>`_
2. Log in to Fly.io with ``flyctl auth login``
3. Run ``flyctl launch`` to create a new app on Fly.io and configure it.
It will ask you to select a region and a name for your app. When done it will
create a ``fly.toml`` file and a ``Dockerfile`` in your project directory.
4. Open the ``Dockefile`` and add modify the ``build`` step to mount the EdgeDB
Cloud secret key and instance name as environment variables:

.. code-block:: dockerfile-diff
:caption: Dockerfile

# Build application
- RUN pnpm run build
+ RUN --mount=type=secret,id=EDGEDB_INSTANCE \
+ --mount=type=secret,id=EDGEDB_SECRET_KEY \
+ EDGEDB_INSTANCE="$(cat /run/secrets/EDGEDB_INSTANCE)" \
+ EDGEDB_SECRET_KEY="$(cat /run/secrets/EDGEDB_SECRET_KEY)" \
+ pnpm run build

5. Run ``flyctl deploy`` to deploy your app to Fly.io. You need to pass the
secrets to the deployment command:

.. code-block:: bash

$ flyctl deploy --secrets EDGEDB_INSTANCE="<EDGEDB_INSTANCE>" \
--secrets EDGEDB_SECRET_KEY="<EDGEDB_SECRET_KEY>"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/guides/cloud/deploy/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ platform-specific instructions:

vercel
netlify
fly
railway
render
6 changes: 3 additions & 3 deletions docs/guides/cloud/deploy/netlify.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.. _ref_guide_cloud_deploy_netlify:

========================
Deploy an app on Netlify
========================
=======
Netlify
=======

:edb-alt-title: Deploying applications built on EdgeDB Cloud to Netlify

Expand Down
27 changes: 27 additions & 0 deletions docs/guides/cloud/deploy/railway.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.. _ref_guide_cloud_deploy_railway:

=======
Railway
=======

:edb-alt-title: Deploying applications built on EdgeDB Cloud to Railway

1. Push project to GitHub or some other Git remote repository
2. Create and make note of a secret key for your EdgeDB Cloud instance
3. From Railway's dashboard, click the "New Project" button
4. Select the repository you want to deploy
5. Click the "Add variables" button to add the following environment variables:

- ``EDGEDB_INSTANCE`` containing your EdgeDB Cloud instance name (in
``<org>/<instance-name>`` format)
- ``EDGEDB_SECRET_KEY`` containing the secret key you created and noted
previously.

6. Click "Deploy"

.. image:: images/cloud-railway-config.png
:width: 100%
:alt: A screenshot of the Railway deployment configuration view
highlighting the environment variables section where a user will
need to set the necessary variables for EdgeDB Cloud instance
connection.
27 changes: 27 additions & 0 deletions docs/guides/cloud/deploy/render.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.. _ref_guide_cloud_deploy_render:

======
Render
======

:edb-alt-title: Deploying applications built on EdgeDB Cloud to Render

1. Push project to GitHub or some other Git remote repository
2. Create and make note of a secret key for your EdgeDB Cloud instance
3. From Render's dashboard, click "New > Web Service"
4. Import your project's repository
5. In your new project's page, click "Environment" to add two variables:

- ``EDGEDB_INSTANCE`` containing your EdgeDB Cloud instance name (in
``<org>/<instance-name>`` format)
- ``EDGEDB_SECRET_KEY`` containing the secret key you created and noted
previously.

6. Click Deploy

.. image:: images/cloud-render-config.png
:width: 100%
:alt: A screenshot of the Render deployment configuration view
highlighting the environment variables section where a user
will need to set the necessary variables for EdgeDB Cloud instance
connection.
6 changes: 3 additions & 3 deletions docs/guides/cloud/deploy/vercel.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.. _ref_guide_cloud_deploy_vercel:

=======================
Deploy an app on Vercel
=======================
======
Vercel
======

:edb-alt-title: Deploying applications built on EdgeDB Cloud to Vercel

Expand Down
3 changes: 3 additions & 0 deletions docs/guides/cloud/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ interface nearly identical to the :ref:`EdgeDB UI <ref_cli_edgedb_ui>`.
deploy/index
deploy/vercel
deploy/netlify
deploy/fly
deploy/render
deploy/railway


Questions? Problems? Bugs?
Expand Down
3 changes: 2 additions & 1 deletion tests/test_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,8 @@ def run_block_test(self, block):
'tsx',
'elixir',
'toml',
'sql'
'sql',
'dockerfile'
}:
pass
elif lang[-5:] == '-diff':
Expand Down