packages/docs/docs/cloudrun/deploysite.mdx
Takes a Remotion project, bundles it and uploads it to an Cloud Storage bucket. Once uploaded, a Cloud Run service can render any composition in the Remotion project by specifying the URL.
siteName to overwrite the previous site.getOrCreateBucket().import {deploySite} from '@remotion/cloudrun';
import path from 'path';
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);
An object with the following properties:
entryPointAn absolute path pointing to the entry point of your Remotion project. Usually the entry point in your Remotion project is stored at src/entry.tsx.
bucketNameThe bucket to where the website will be deployed. The bucket must have been created by Remotion Cloud Run.
siteName?Specify the subfolder in your Cloud Storage bucket that you want the site to deploy to. If you omit this property, a new subfolder with a random name will be created. If a site already exists with the name you passed, it will be overwritten. Can only contain the following characters: 0-9, a-z, A-Z, -, !, _, ., *, ', (, )
logLevel?<AvailableFrom v="4.0.140"/>options?An object with the following properties:
onBundleProgress?Callback from Webpack when the bundling has progressed. Passes a number between 0 and 100 to the callback, see example at the top of the page.
onUploadProgress?Callback function that gets called when uploading of the assets has progressed. Passes an object with the following properties to the callback:
totalFiles (number): Total number of files in the bundle.filesUploaded (number): Number of files that have been fully uploaded so far.totalSize (number): Total size in bytes of all the files in the bundle.sizeUploaded (number): Amount of bytes uploaded so far.webpackOverride?Allows to pass a custom webpack override. See bundle() -> webpackOverride for more information.
enableCaching?publicDir?rootDir?The directory in which the Remotion project is rooted in. This should be set to the directory that contains the package.json which installs Remotion. By default, it is the current working directory.
:::note The current working directory is the directory from which your program gets executed from. It is not the same as the file where bundle() gets called. :::
ignoreRegisterRootWarning?Ignore an error that gets thrown if you pass an entry point file which does not contain registerRoot.
keyboardShortcutsEnabled?<AvailableFrom v="4.0.407"/>askAIEnabled?<AvailableFrom v="4.0.407"/>experimentalClientSideRenderingEnabled?<AvailableFrom v="4.0.407"/>rspack?<AvailableFrom v="4.0.426"/>An object with the following values:
serveUrlstring
An URL such as https://storage.googleapis.com/remotioncloudrun-123asd321/sites/abcdefgh/index.html.
You can use this "Serve URL" to render a video on Remotion Cloud Run using:
npx remotion cloudrun render commandrenderMediaOnCloudrun() and renderStillOnCloudrun() functions.renderMedia() and renderStill() functions.npx remotion render and npx remotion still commandsIf you are rendering on Cloud Run, you can also pass the site name (in this case abcdefgh) as an abbreviation.
siteNamestring
The identifier of the site that was given. Is either the site name that you have passed into this function, or a random string that was generated if you didn't pass a site name.
statsAn object with 3 entries:
uploadedFilesdeletedFilesuntouchedFilesEach one is a number.