Capítulo 455 de 988

Chapter 455: deploySite()

Core Idea

:::info Deprecated Prefer building with bundle() and uploading its output with deploySiteFromBundle(). Separating these steps avoids rebuilding an unchanged bundle during deployment.

Key Concepts

  • Example
  • Arguments
  • entryPoint
  • bucketName
  • region
  • siteName?
  • logLevel?<AvailableFrom v="4.0.140"/>
  • options?

Code Examples

const {serveUrl} = await deploySite({
  entryPoint: path.resolve(process.cwd(), 'src/index.ts'),
  bucketName: 'remotionlambda-c7fsl3d',
  region: 'us-east-1',
  options: {
    onBundleProgress: (progress) => {
      // Progress is between 0 and 100
      console.log(`Bundle progress: ${progress}%`);
    },
    onUploadProgress: ({totalFiles, filesUploaded, totalSize, sizeUploaded}) => {
      console.log(`Upload progress: Total files ${totalFiles}, Files uploaded ${filesUploaded}, Total size ${totalSize}, Size uploaded ${sizeUploaded}`);
    },
  },
});
console.log(serveUrl);
  • What it demonstrates: Usage pattern for deploySite() from the official docs.

Key Takeaways

  1. Understand example when working with deploySite().
  2. Understand arguments when working with deploySite().
  3. Understand entrypoint when working with deploySite().
  4. Understand bucketname when working with deploySite().
  5. Understand region when working with deploySite().

Connects To

  • api: related page in the Lambda (@remotion/lambda) section.
  • Approuterwebhook: related page in the Lambda (@remotion/lambda) section.
  • Authentication: related page in the Lambda (@remotion/lambda) section.