Using 1-Click Deploy
This tutorial will show you how to use Defang 1-Click Deploy to deploy a sample to the Defang Playground.
The 1-Click Deploy button is the easiest way for new users to deploy a sample project to the Defang Playground. No CLI installation is required.
To access the full range of features provided by Defang, we recommend using the Defang CLI.
Step 1 - Choose a Sample
Head to our list of samples and click a sample you want to deploy. Then, click on the button that says "1-Click Deploy".
Alternatively, you can find the "1-Click Deploy" button located in the README.md
file of each sample's GitHub repository.
Step 2 - Login
For 1-click deployments to work, Defang has to have your permission, which you can grant by logging in. If you are already logged in, you will be automatically taken to the next step.
Step 3 - Create Your Repo
Onced logged in, you'll be redirected to GitHub. Click the "Create repository button" to create a new repository with the sample project.
Step 4 - Wait for Deployment to Complete
A Github Action workflow will automatically start running to install Defang and deploy the sample to the Defang Playground. You can see this by going into the "Actions" tab in your GitHub repository.
You can view the status of your deployment in the Defang Portal, or by downloading the Defang CLI. You can also see deployment progress in the "Actions" tab of your GitHub repository:
If you decide to make a commit later to a repository created from 1-Click Deploy, then the project will automatically get deployed again to Defang Playground.
When it is completed, you can view your deployed app using the deployment link generated by Defang, which should appear similar to the format below:
https://<username>-<service-name>--<port>.defang.dev
Configuration in 1-Click Deploy
If the sample you chose requires setting configuration, such as API keys, you can set sensitive config values as secrets in your GitHub repository and the GitHub Action can automatically handle those values for you. Learn how to manage config values with the Defang Github Action.