Skip to main content

Git Push to Deploy

It's a good idea to create a CI/CD pipeline to deploy your SST apps to production. It allows you to work together with your team. There are a couple of ways to do so.

The easiest way to deploy SST to production is to use Seed. Seed is a fully-managed CI/CD pipeline for serverless apps on AWS. It's built by the creators of SST.

There are a couple of other reasons why Seed is a good fit for SST apps.

  1. Speed

    It's the fastest way to deploy SST apps. Seed automatically caches dependencies to speed up your builds.

  2. Free

    Seed also directly plugs into the SST deployment process. So when an SST app is waiting for CloudFormation to update your stacks, Seed pauses the build process and does this asynchronously. This allows Seed to make SST deployments very efficient and offer it to you for free!

Getting startedโ€‹

If you havenโ€™t already done so, push your SST app to a Git provider of your choice: GitHub, GitLab, or BitBucket. Your repository can be private or public.

Then, follow these steps in the Seed docs to add your SST app.

Pull Request workflowโ€‹

By enabling the Pull Request workflow, when a PR is opened, Seed will build, test, and deploy the pull request commits automatically to a new stage. The new pull request stage will be an independent clone of your production environment.

Using the PR workflow allows you to share deployment previews with your team. This, in addition to doing code reviews allows you to have a consistent process around how changes get pushed to production.

Other providersโ€‹

In addition to Seed, there are other general purpose CI providers that you can use to deploy your SST apps:

  1. Github Actions
  2. Travis CI
  3. CircleCI

Here's what you'll need to add to your CI build scripts. Assuming your production stage is called prod.

$ npm install
$ npx sst deploy --stage prod

# With Yarn

$ yarn
$ yarn sst deploy --stage prod

And that's it! You have a fully functioning app deployed and ready to be used. You can manage it with the SST Console and Git push to deploy it with Seed.