{
  "name": "amaechler.github.io",
  "version": "1.0.0",
  "author": "Andreas Maechler <amaechler@gmail.com>",
  "devDependencies": {
    "gatsby": "^2.15.29",
    "gatsby-theme-blog": "^1.0.2",
    "gh-pages": "^2.1.1",
    "react": "^16.10.2",
    "react-dom": "^16.10.2"
  },
  "private": true,
  "scripts": {
    "develop": "gatsby develop",
    "deploy": "rm -rf public .cache && gatsby build && gh-pages -d public",
    "build": "gatsby build"
  }
}

{
  "name": "amaechler.github.io",
  "version": "1.0.0",
  "author": "Andreas Maechler <amaechler@gmail.com>",
  "devDependencies": {
    "gatsby": "^2.15.29",
    "gatsby-theme-blog": "^1.0.2",
    "gh-pages": "^2.1.1",
    "react": "^16.10.2",
    "react-dom": "^16.10.2"
  },
  "private": true,
  "scripts": {
    "develop": "gatsby develop",
    "deploy": "rm -rf public .cache && gatsby build && gh-pages -d public && rm -rf public",
    "build": "gatsby build"
  }
}

Delete public folder after deploy
Delete public folder after deploy
