You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tutorials/adding-custom-one-click-deploy.md
+30-8Lines changed: 30 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,12 +8,15 @@ description: Add a custom 1-Click Deploy link to deploy your own app.
8
8
9
9
This tutorial will show you how to add a 1-Click Deploy link to deploy your app to the Defang Playground.
10
10
11
-
A 1-Click Deploy link points to a special Defang URL. Clicking this link will trigger a deployment of a project to Defang. The link is often placed as a button in the `README.md` file of your project repository, and is the easiest way to allow anyone to deploy a clone of your app.
11
+
The link is often placed as a button in the `README.md` file of your project repository, and is the easiest way to allow anyone to deploy your app.
12
12
13
13
:::info
14
14
If you are trying to use 1-Click Deploy with one of our [samples](https://defang.io/samples/), we have a separate tutorial on [how to use 1-Click Deploy](/docs/tutorials/using-one-click-deploy).
15
15
:::
16
16
17
+
### How 1-Click Deploy Works
18
+
A 1-Click Deploy link points to a special URL. Clicking this link will prompt the user to create a new GitHub repo with a clone of your project. This new repo will contain a GitHub Actions workflow which will automatically deploy the project to Defang.
19
+
17
20
## Pre-requisites
18
21
19
22
- A [GitHub](https://github.com/) repository for your project
To support 1-Click Deploy, your repository must be a [Template Repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template). In order to make your repository into a Template Repository, complete the following steps:
62
+
1. Go to the repository's "Settings" near the right on the top bar.
63
+
2. Select the "Template repository" box to turn your repo into a template repo, as seen below:
Now stay on this page and continue to the next step.
77
+
78
+
## Step 4 - Get the Encoded URL
57
79
58
-
You will need the encoded version of your project repository's URL. This will be used as a redirect for the 1-Click Deploy link.
80
+
You will need the encoded version of the URL of the page from the previous step. This will be used as a redirect for the 1-Click Deploy link.
59
81
60
-
1. Copy the URL of your repository's homepage. It should look something like the following:
82
+
1. Copy the URL of the page you are on ( "Create a new repository" page sourced from your template repository). It should look something like the following:
2. You can go online and paste the URL from the step above into a URL encoder tool of your choice. You should end up with an encoded URL, similar to the one shown below:
You will need to create a 1-Click Deploy link with the following format: `https://portal.defang.dev/redirect?url=` + your encoded URL. This ensures that the user can get [logged in](/docs/concepts/authentication/) to Defang before they get redirected to clone your app for deployment.
73
95
@@ -77,7 +99,7 @@ Optionally, you can add `&name=<your-suggested-name>` to the end of the link if
77
99
78
100
The finished link should look similar to the one below:
0 commit comments