Giter Club home page Giter Club logo

gatsby-calendar's Introduction

ondecentral.com

Landing page 2/2/2022

start gatsby dev server gatsby develop
build static site gatsby build

How to deploy

On your local machine:

gatsby build
make deploy-site

Notes:

  • If you dont have make installed, ๐Ÿ‘‰ macOS, Windows
  • Before running $ make deploy-site , make sure you have access to the ssh server and you have the eys configured and the /public folder is built in your project

Pre-req

Developer System Dependencies

If on Mac

npm install --global yarn

Pre-req

Install yarn on cloud instances

curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn
sudo apt-get install libpng-dev

Ensure access

To minimize the chance of permissions errors, configure npm to use a different directory. This will show you how to create and use a hidden directory in your home directory.

On the command line in ~, create a directory for global installations:

mkdir ~/.npm-global

Config npm to use the new dir path:

npm config set prefix '~/.npm-global'

In RHEL cloud vi open former else open latter

~/.bashrc OR ~/.profile

file and upsert line:

export PATH=~/.npm-global/bin:$PATH

On the command line update those system variables:

source ~/.profile

Test your new config by installing a package globally without using sudo

Common pain points

Node gyp on mac Debug article

Node GYP Error on Apple Silicon Mac (Tried on M1 Mac) Debug Article

Deploy Staging

Assuming you are on Ubuntu AWS

Also reminder to

sudo apt-get install build-essential

Back up your computer. On the command line, in your home directory, create a directory for global installations:

 mkdir ~/.npm-global

Configure npm to use the new directory path:

npm config set prefix '~/.npm-global'

If it's not already in your bashrc already, in your preferred text editor, open or create a ~/.bashrc file (~/.bash_profile on OSX) and add this line:

echo "export PATH=~/.npm-global/bin:$PATH" >> ~/.bashrc

On the command line, update your system variables:

source ~/.bashrc

To test your new configuration, install a package globally without using sudo:

npm install -g jshint

Will be needed.

Normal Dev

npm install -g gatsby-cli

PROTIP: Don't forget to run gatsby telemetry --disable afterwards

On a Macbook Pro

If you haven't ran the code in a while

yarn upgrade

verified to resolve the issue on osx local dev

Otherwise

yarn add babel-preset-gatsby --dev

Remember to save dev

yarn
yarn build

Run with local http-server if staging

./node_modules/http-server/bin/http-server public/ -p 7000

if on local dev environemnt run

yarn start
npx http-server public/ -p 6000

Add pm2 and run with ./pm2 list to test prior to production start

yarn add pm2
pm2 serve public/ 80

Deploying Manually

  1. Check with admin on Domain and AWS Route 53 configuration
  2. You'll need to run yarn build
  3. Upload contents to the s3 bucket
  4. Invalidate Cache on Cloudfront on paths /*

Troubleshooting

If you are running OSX Ventura on Apple Silicon

Assumptions: you are using yarn and building locally

And you are getting an issue with the npm package sharp

The solution is contained here nuxt/image#204

Other Builds

Issue when installing NPM module sharp

  • Remove hidden config file in home directory rm -rf ~/.pm2

zsh: command not found: yarn

  • Run source ~/.profile

gatsby-calendar's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.