Platform.sh is now Upsun. Click here to learn more
Upsun Fixed User Documentation

Deploy Gatsby

Try Upsun for 15 days
After that, enjoy the same, game-changing Upsun features for less with the First Project Incentive!¹ A monthly $19 perk!
Activate your 15-day trial
¹Terms and conditions apply

Deployment Anchor to this heading

Now you have your configuration for deployment and your app set up to run on Upsun Fixed. Make sure all your code is committed to Git and run git push to your Upsun Fixed environment.

Your code is built, producing a read-only image that’s deployed to a running cluster of containers. If you aren’t using a source integration, the log of the process is returned in your terminal. If you’re using a source integration, you can get the log by running platform activity:log --type environment.push.

When the build finished, you’re given the URL of your deployed environment. Click the URL to see your site.

If your environment wasn’t active and so wasn’t deployed, activate it by running the following command:

platform environment:activate

Additional changes Anchor to this heading

A standard Gatsby site - either one created interactively through npm (npm init gatsby) or through a starter such as the Blog starter used in the Upsun Fixed template - will generate a static site without the use of any external services. If this is your starting point you have all of the configuration necessary to deploy your project, but below are a few modifications that may help you develop your site more efficiently going forward.

Install the Config Reader Anchor to this heading

You can get all information about a deployed environment, including how to connect to services, through environment variables. Your app can access these variables.

Install the package with your preferred package manager:

npm install platformsh-config

# Or for Yarn
yarn add platformsh-config

Go forth and Deploy (even on Friday)!