Vyacheslav Koldovskyy programmingmentor.com t.me/programmingmentor
https://dou.ua/lenta/articles/creating-blog-with-jamstack/
Why wait for pages to build on the fly when you can generate them at deploy time? When it comes to minimizing the time to first byte, nothing beats pre-built files served over a CDN.
When your deployment amounts to a stack of files that can be served anywhere, scaling is a matter of serving those files in more places. CDNs are perfect for this, and often include scaling in all of their plans.
With server-side processes abstracted into microservice APIs, surface areas for attacks are reduced. You can also leverage the domain expertise of specialist third-party services.
Loose coupling and separation of controls allow for more targeted development and debugging, and the expanding selection of CMS options for site generators remove the need to maintain a separate stack for content and marketing.
goo.gl/6tz3Ne
npm i -g gatsby-cli
gatsby new web-great-again https://github.com/gatsbyjs/gatsby-starter-blog
cd web-great-again
code .
gatsby develop
gatsby build
npm i -g firebase-tools
firebase login
firebase init
firebase use --projectID
firebase deploy
npm install --save-dev firebase-tools
"devDependencies": {
"firebase-tools": "^6.5.0"
}
firebase login:ci
// save key
#
# CircleCI 2.0 Gatsby to Firebase Configuration File
#
version: 2
jobs:
build:
docker:
- image: circleci/node:8
working_directory: ~/repo
steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
# Find a cache corresponding to this specific package-lock.json checksum
# when this file is changed, this key will fail
- v1-npm-deps-{{ checksum "package-lock.json" }}
# Find the most recently generated cache used from any branch
- v1-npm-deps-
- run:
name: Install Dependencies
command: npm install
- save_cache:
key: v1-npm-deps-{{ checksum "package-lock.json" }}
paths:
- ./node_modules
- run:
name: Gatsby Build
command: ./node_modules/.bin/gatsby build
- run:
name: Firebase Deploy
command: ./node_modules/.bin/firebase deploy --token=$FIREBASE_TOKEN
.circleci/config.yml
Vyacheslav Koldovskyy programmingmentor.com t.me/programmingmentor