🛠 Tech Stack
- End-to-end tests with Cypress and start-server-and-test
- Continuously tested (CI) on CircleCI
- Continuously deployed (CD) on Netlify, with support for Deploy previews of Pull Requests
- Dependabot to keep dependencies secure and up-to-date
🛠 Installation & Set Up
Clone the repo
git clone https://github.com/rm3l/rm3l.org my-jamstack-site && cd my-jamstack-site
Install and use the correct version of Node using NVM
Install the Gatsby CLI
npm install -g gatsby-cli
Install YARN package manager
Follow the instructions here: https://legacy.yarnpkg.com/en/docs/install
Install the project dependencies
Set up environment variables and customize the project
.env.template as a
.env file in the repo and customize it accordingly:
GHOST_API_URL=https://my.healdless.ghost.entrypoint GHOST_CONTENT_API_KEY=my-ghost-blog-content-key CYPRESS_PROJECT_ID=my-cypress-project-id CYPRESS_RECORD_KEY=my-cypress-record-key
GHOST_API_URL: the URL to the headless Ghost blog
GHOST_CONTENT_API_KEY: the Ghost Content API Key, which allows to pull data from a Ghost CMS
CYPRESS_PROJECT_ID: the Cypress project Identifier
CYPRESS_RECORD_KEY: the Cypress project record key, to use in a Cypress online dashboard
On build servers (CircleCI and Netlify), those are just defined as project-wide environment variables.
- Change the site configuration
Edit the src/utils/siteConfig.js file accordingly.
Start the development server
develop uses the
development config in
🚀 Building and Running for Production
Generate a full static production build
# Run a production build, locally gatsby build
Preview the site as it will appear once deployed
# Serve a production build, locally gatsby serve
build uses the
production config in
This repository contains few Cypress end-to-end tests that not only make sure the website renders as expected,
but also test accessibility (also known as a11y).
To do so, the
test commands spin up the Gatsby development server and run all the Cypress test specs against the former.
You can run the tests using the following command:
# Runs the tests right away, with no user interaction yarn test
# Interactive test launcher: opens up a Cypress browser for interactively running the tests yarn test:open
Deploying with Netlify
This contains 3 config files specifically for deploying with Netlify. A
netlify.toml file for build settings, a
/static/_headers file with default security headers set for all routes, and
/static/_redirects to set Netlify custom domain redirects.
To deploy to your Netlify account, hit the button below.
You need however to leverage your own Ghost Content API Keys which allow Gatsby to communicate with your Ghost headless blog. For this, I currently set Netlify ENV variables for production builds instead.
Once deployed, I also set up a Ghost + Netlify Integration to use deploy hooks from Ghost to trigger Netlify rebuilds. That way, any time data changes (e.g., new post published) in the headless Ghost CMS, my website will rebuild on Netlify.
The MIT License (MIT) Copyright (c) 2020 Armel Soro Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.