LogoLogo
  • Welcome to Release
  • Getting started
    • Quickstart
    • Create an account
    • Prepare to use Release
    • Create an application
      • Create custom application
      • Create from template
      • Servers vs runnables
    • Create an environment
  • Guides and examples
    • Domains and DNS
      • Manage domains
      • DNS and nameservers
        • Configure GoDaddy
        • Configure Cloudflare
        • Configure Namecheap
        • Other DNS hosts
      • Routing traffic
    • Example applications
      • Full stack voting app
      • Flask and RDS counter app
      • Static site with Gatsby
      • Golang with Postgres and Nginx
      • WordPress with MySQL
      • Spring and PostgreSQL
      • Terraform and Flask
      • OpenTelemetry demo
      • Load balancer with hostname
      • Static JavaScript service
      • SSH bastion access to services
      • ngrok and OAuth for private tunnels
      • Using OAuth Proxy
      • Hybrid Docker and static site
      • App Imports: Connecting two applications
      • Example library
    • Running instances
      • Cron jobs
      • Jobs
      • Using Helm charts
      • Using terminal
      • Viewing logs
      • Troubleshooting
        • ImagePullBackoff error
        • CrashLoopBackoff error
        • Exit codes
        • OOM: out of memory
    • Advanced guides
      • Containers guide
      • Application guide
      • Kubernetes guide
      • Create a cluster
      • Upgrade a cluster
      • Managing node groups
      • Patch node groups
      • Hostnames and rules
      • Serve traffic on multiple ports
      • Configure access to your K8s cluster
      • Designing for multiple environments
      • Microservices architecture
      • Monitoring your clusters
      • Performance tuning
      • Visibility and monitoring
      • Working with data
        • Container-based data
        • Seeding and migration
        • Cloud-provided data
        • Golden images
        • Third party
      • Pausing Instant Datasets
        • Application pausing schedules
        • Pause/resume environments
      • Infrastructure as code
        • Terraform
  • Reference documentation
    • Account settings
      • Account info
      • Managing users
      • Build settings
        • Build arguments
        • Build SSH keys
      • Add integrations
      • View clusters and cloud integrations
      • Add datasets
      • Environment handles
    • Workflows in Release
      • Stages of workflows
      • Serial deployments
      • Parallel deployments
      • Rolling deployments
      • Rainbow deployments
    • Networking
      • Network architecture (AWS)
      • Network architecture (GCP)
      • Ingresses
      • IP addresses
      • Cloud-provided services
      • Third-party services
    • Release environment versioning
    • Application settings
      • Application Template
        • Schema definition
      • Default environment variables
      • GitHub
      • Pull requests
      • GitOps
      • Just-in-time file mounts
      • Primary App Link
      • Create application FAQ
      • App-level build arguments
      • Parameters
      • Workspaces
    • End-to-end testing
    • Environment settings
      • Environment configuration
      • Environment variables
        • Environment variable mappings
        • Secrets vaults
        • Using Secrets with GitOps
        • Kubernetes Secrets as environment variables
        • Managing legacy Release Secrets
    • Environment expiration
    • Environment presets
    • Instant datasets on AWS
    • Instant datasets on GCP
    • Instant dataset tasks
      • Tonic Cloud
      • Tonic On-Premise
    • Cloud resources
    • Static service deployment
    • Helm
      • Getting started
      • Version-controlled Helm charts
      • Open-source charts
      • Building Docker images
      • Ingress and networking
      • Configuration
    • GitOps
    • The .release.yaml file
    • Docker Compose conversion support
    • Reference examples
      • Adding and removing services
      • Managing service resources
      • Adding database containers to the Application Template
      • Stock Off-The-Shelf Examples
    • Release API
      • Account Authentication
      • Environments API
        • Create
        • Get
        • Setup
        • Patch
      • User Authentication
      • Environment Presets API
        • Get Environment Preset List
        • Get Environment Preset
        • Put Environment Preset
  • Background concepts
    • How Release works
  • Frequently asked questions
    • Release FAQ
    • AWS FAQ
    • Docker FAQ
    • JavaScript FAQ
  • Integrations
    • Integrations overview
      • Artifactory integration
      • Cloud integrations (AWS)
        • AWS guides
        • Grant access to AWS resources
        • AWS how to increase EIP quota
        • Control your EKS fleet with systems manager
        • Managing STS access
        • AWS Permissions Boundaries
        • Private ECR Repositories
        • Using an Existing AWS VPC
        • Using an Existing EKS Cluster
      • Docker Hub integration
      • LaunchDarkly integration
      • Private registries
      • Slack integration
      • Cloud integrations (GCP)
        • GCP Permissions Boundary
      • Datadog Agent
      • Doppler Secrets Manager
      • AWS Secrets Management
    • Source control integrations
      • GitHub
        • Pull request comments
        • Pull request labels
        • GitHub deployments
        • GitHub statuses
        • Remove GitHub integration
      • Bitbucket
      • GitLab
    • Monitoring and logging add-ons
      • Datadog
      • New Relic
      • ELK (Elasticsearch, Logstash, and Kibana)
  • Release Delivery
    • Create new customer integration
    • Delivery guide
    • Release to customer account access controls
    • Delivery FAQs
  • Release Instant Datasets
    • Introduction
    • Quickstart
    • Security
      • AWS Instant Dataset security
    • FAQ
    • API
  • CLI
    • Getting started
    • Installation
    • Configuration
    • CLI usage example
    • Remote development environments
    • Command reference
      • release accounts
        • release accounts list
        • release accounts select
      • release ai
        • release ai chat
        • release ai config-delete
        • release ai config-init
        • release ai config-select
        • release ai config-upsert
      • release apps
        • release apps list
        • release apps select
      • release auth
        • release auth login
        • release auth logout
      • release builds
        • release builds create
      • release clusters
        • release clusters exec
        • release clusters kubeconfig
        • release clusters shell
      • release datasets
        • release datasets list
        • release datasets refresh
      • release deploys
        • release deploys create
        • release deploys list
      • release development
        • release development logs
        • release development start
      • release environments
        • release environments config-get
        • release environments config-set
        • release environments create
        • release environments delete
        • release environments get
        • release environments list
        • release environments vars-get
      • release gitops
        • release gitops init
        • release gitops validate
      • release instances
        • release instances exec
        • release instances logs
        • release instances terminal
  • Release.ai
    • Release.ai Introduction
    • Getting Started
    • Release.ai Templates
    • Template Configuration Basics
    • Using GPU Resources
    • Custom Workflows
    • Fine Tuning LlamaX
    • Serving Inference
Powered by GitBook
On this page
  • Overview
  • Get the example project
  • Source control integration
  • The App Dashboard status page
  • View environment details
  • Modify the application and deploy changes
  • Deploy to a different branch

Was this helpful?

  1. Guides and examples
  2. Example applications

Static site with Gatsby

PreviousFlask and RDS counter appNextGolang with Postgres and Nginx

Last updated 2 years ago

Was this helpful?

Overview

You can use Release to deploy static sites to the Release CDN. Release can detect services inside your application that are eligible for and you can choose to build and deploy these to the Release CDN, ensuring fast performance at the edge.

In this example, we'll use to deploy a simple static site to the CDN. Gatsby is an open-source frontend framework designed to help you build fast, scalable, and SEO-optimised static sites. It's often used to run company blogs or websites.

Here's a look at the site we'll deploy to Release:

We'll also take a look at how to manage and update the site once it is deployed.

Get the example project

Once you’ve forked the repository to your account, clone your copy to your development machine.

git clone https://github.com/awesome-release/gatsby-starter-theme

Source control integration

Once you’ve forked and cloned the repository, you can use the Release UI to integrate directly with your source-control provider (either GitHub or GitLab in this case).

When signing in, Release will ask for read/write access to the provider API so that it can list and view your repositories.

If you use the same email address across Bitbucket, GitLab, and GitHub, Release will automatically list a combined view of repositories for you. Each integration will appear separately on your profile page.

This will open a six-step form to help you create your application. The steps are as follows:

  1. Create your application: Enter a name and select your repository.

  2. Analyze your repository: Let Release scan your repository for services, then select which services to add to your application.

  3. Generate a template: Based on the services you selected from your repository, Release generates a template for your application.

  4. Set environment variables: Set the default environment variables for your new application.

  5. Set build arguments: Set arguments to use when Release builds your application's Docker images.

  6. Save and deploy: Deploy your new application.

Give the application a name and pick a repository and then click the Next Step button.

Ensure that you have selected the correct branch for your repository to be built and deployed from (in this case, it is the master branch). From the Select files dropdown, select the package.json file for Release to analyze and click Start Analysis. Release will now read the file you selected and create a list of services found.

Release will automatically detect that your project contains static assets that are eligible for static asset deployment.

Double-check that Release has inferred the correct configuration for the project.

The service type dropdown should be set to Static with the Build Command being yarn build. The build Output Directory should be set to public. Click Next Step to move to the template generation step.

The Application Template acts as a blueprint for new environments in this application. Release creates a template based on the services you selected in step two. You can edit the template or proceed to the next step.

In this step, you can set default environment variables that will be available for all environments for your application. These environment variables consist of a key, a value, and an optional secret flag. For this application, you can proceed without setting environment variables.

In the next step, you can set build arguments. Build arguments are passed to Release's build process. You can proceed without setting build arguments for this application.

You've created your application and it is now time to save and deploy the application.

The App Dashboard status page

While your application builds and deploys, you will be redirected to the App Dashboard status page.

Here you can explore environments, builds, and deploys related to your application. You can also modify application-specific settings.

Click on the Builds tab to see a successful build for your Gatsby application.

Once an ephemeral environment has been created and successfully deployed for your application, you should see a prompt.

You can also view this environment by clicking on the Environments tab.

View environment details

Click on the name of an environment in the Environments tab to be taken to the Environment Details page.

Here you can view granular information about a particular environment, including the application instances deployed into it and the hostname URLs that exist.

Click the hostname URL to go to your static website hosted on Release.

Modify the application and deploy changes

In the real world, we would probably want to make changes to our application and redeploy it. Let’s add a new blog post to our application to see how this works.

Change directory into the repository we cloned earlier and open it in a text editor.

Create a new file in the content/post directory called hello-release.mdx. Add the following content to your newly created file:

---
title: Hello Release
date: 2022-06-01
---

Hello, Release! This is a demo post illustrating how to make a change and redeploy a static website on Release.

Commit and push these changes to your remote repository:

git add content/
git commit -m "Add a new post"
git push

Once you’ve pushed the changes, Release will automatically start a new build and deployment based on the latest commit in your repository.

Once the deployment is complete, you should be able to see the updated blog at the same hostname URL you accessed earlier.

Deploy to a different branch

You probably don't want to deploy new changes directly to a production environment. Instead, you may have a development branch where you can send changes for review. Release allows you to create a new environment for this.

Let’s create a development branch in our repository and push a change to it.

% git checkout -b develop
Switched to a new branch 'develop'

Create a new file in content/posts called staged-post.mdx and add the following content to it:

---
title: Hello Release - Staged
date: 2022-06-01
---

This is a staged post that isn't in production yet.

Push the newly created develop branch remotely, including the new staged post:

% git add .
% git commit -m "add new staged post"
[develop 3a00048] add new staged post
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 content/posts/staged-post.mdx
% git push --set-upstream origin develop

Navigate to the Environments tab in the App Dashboard of your application.

Click on Create New Environment and specify the develop branch.

When you click Create Environment, Release will automatically build and deploy from the development branch.

View the deployed application by navigating to the hostname URL specified for this environment on its Environment Details page. You can now iterate and make changes on this branch without impacting your main environment.

You can get the code for this project by forking the repository on . By forking the repository containing the code, you create a copy of it on your account. You can then edit this copy as you wish without needing permissions on the original project.

To start, ensure that you are to your Release account with the SSO provider for your source control integration.

Once you’ve signed in, click the Create New App button on the .

GitHub
signed in
home page
static service deployment
Gatsby