Node JS

Deploying Static Site Generator applications

Deploying SSG applications with Code Assembly disabled

Use the following steps to deploy Front End Hosting - Basic Static Site Generator (SSG) applications when Code Assembly is disabled in Cloud Platform:

  1. Ensure that the commits in the branch contain a build artifact.

    The build artifact is the output directory that is generated after running the npm install and npm run build commands.

  2. Push the commits and deploy the code to an environment through the branch.

    For example, if the master branch is deployed to the Dev environment, commits including the ready-to-deploy built bundle are pushed to the master branch, with no further npm commands.

Use the following specifications when deploying SSG applications with Code Assembly disabled:

SpecificationValue
Development branchmaster
Deployment branchmaster
What code is pushedbuilt bundle
Who runs npm install, npm run buildDeveloper

Deploying SSG applications with Code Assembly enabled

Enabling Code Assembly involves the following two branches:

  • A manually-created branch for the development code
  • An auto-generated branch for deployment

Use the following steps to deploy SSG applications when Code Assembly is enabled in Cloud Platform:

  1. Create a development branch for the development code.

  2. Push the development code to the branch.

    Code Assembly runs the npm install and npm run build commands, and creates a new CODE-ASSEMBLY-BUILD-<BRANCH_NAME> branch with the build artifact.

  3. Deploy the code to an environment through the new branch.

    For example, if the master branch is used for development, commits are pushed to the master branch. Commits do not include a built bundle and only include the development code. Code Assembly builds the code and creates a new CODE-ASSEMBLY-BUILD-master branch, which is used for deploying the code to an environment.

Important
  • Commits to the development branch must include only the development code. If this branch includes the node_modules folder, Code Assembly returns an error.

  • Avoid committing directly to the auto-generated deployment branch because this branch is overwritten with each new commit to the development branch.
  • To view Code Assembly logs, refer to the application task logs in the user interface. For more information, visit Viewing tasks.

Use the following specifications when deploying SSG applications with Code Assembly enabled:

SpecificationValue
Development branchmaster
Deployment branchCODE-ASSEMBLY-BUILD-master
What code is pusheddevelopment code
Who runs npm install, npm run buildCode Assembly

Build minutes

As part of the code build/deployment process, several commands run in the background to produce a build artifact and deploy it to an environment. This process encompasses cloning/pushing code to a repository, running npm install and npm run build commands to generate the deployable bundle for an environment's branch (when Code Assembly is enabled), and deploying the application steps. The total time consumed for building is tracked as "build minutes."

A build can last up to 45 minutes. If it exceeds this duration, the build/deployment fails. By default, each application is allocated 10,000 build minutes per month. If a customer exceeds this limit, Code Assembly remains usable but your account manager is notified to contact the account holder for an entitlement upgrade. In overuse instances, account managers provide the necessary details to customers. Customers may also purchase additional build minutes as needed. For more information, contact your account manager. Build minutes include repo clone duration, npm install, build time, and git push time.

References

Did not find what you were looking for?

If this content did not answer your questions, try searching or contacting our support team for further assistance.

Acquia Help

Filter by product:

Node JS common questions