Platform.sh User Documentation

Deploy Gatsby

Try for 30 days
Flexible, version-controlled infrastructure provisioning and development-to-production workflows
Activate your trial

Deployment Anchor to this heading

Now you have your configuration for deployment and your app set up to run on Platform.sh. Make sure all your code is committed to Git and run git push to your Platform.sh 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 Platform.sh 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)!

Is this page helpful?