Capítulo 539 de 988

Chapter 539: deploySite()

Core Idea

<ExperimentalBadge> <p> Cloud Run is in <a href="/docs/cloudrun/status">Alpha status and not actively being developed.

Key Concepts

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

Code Examples

const {serveUrl} = await deploySite({
  entryPoint: path.resolve(process.cwd(), 'src/index.ts'),
  bucketName: 'remotioncloudrun-c7fsl3d',
  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 sitename? when working with deploySite().

Connects To

  • api: related page in the Cloud Run (@remotion/cloudrun) section.
  • Checklist: related page in the Cloud Run (@remotion/cloudrun) section.
  • cli: related page in the Cloud Run (@remotion/cloudrun) section.