Deploy your Astro Site to Clever Cloud
此内容尚不支持你的语言。
Clever Cloud is a European cloud platform that provides automated, scalable services.
Project Configuration
Section titled Project ConfigurationYou can deploy both fully static and on-demand rendered Astro projects on Clever Cloud. Regardless of your output
mode (pre-rendered or on-demand), you can choose to deploy as a static application which runs using a post-build hook, or as a Node.js application, which works out-of-the-box with your package.json
.
Port and host
Section titled Port and hostApplications on Clever Cloud listen on port 8080. If your project requires this configuration, set your port and host in Astro in one of two locations:
-
In
package.json
scripts: -
In
astro.config.mjs
:
Deploy Astro from the Console
Section titled Deploy Astro from the ConsoleTo deploy your Astro project to Clever Cloud, you will need to create a new application. The application wizard will walk you through the necessary configuration steps.
-
From the lateral menubar, click Create > An application
-
Choose how to deploy:
- Create a brand new app: to deploy from a local repository with Git
or
- Select a GitHub repository: to deploy from GitHub
-
Select a Node.js application, or a static one.
-
Set up the minimal size for your instance and scalability options. Astro sites can typically be deployed using the Nano instance. Depending on your project’s specifications and dependencies, you may need to adjust accordingly as you watch the metrics from the Overview page.
-
Select a region to deploy your instance.
-
Skip connecting Add-ons to your Clever application unless you’re using a database or Keycloak.
-
Inject environment variables:
- For Node.js, no specific environment variable is needed to deploy Astro if you’re using npm. If you’re using yarn or pnpm, set the following environment variables:
- For a static application, add these variables:
-
Deploy! If you’re deploying from GitHub, your deployment should start automatically. If you’re using Git, copy the remote and push on the master branch.
To deploy from branches other than master
, use git push clever <branch>:master
.
For example, if you want to deploy your local main
branch without renaming it, use git push clever main:master
.
Official Resources
Section titled Official Resources- Clever Cloud documentation for deploying a Node.js application
- Clever Cloud documentation for deploying Astro as a static application