環境
ローカル: macOS Mojave 10.14.5
レンタルサーバー: さくらvps centos7
やりたいこと
Gatsbyという静的サイトジェネレーターで作ったサイトをさくらvpsの公開ディレクトリに手軽にデプロイする環境を作りたいです。
Gatsbyのディレクトリ構成
.cache node_modules public // このディレクトリのみ公開ディレクトリにデプロイしたい src .env.development .env.production .gitignore .prettierrc gatsby-browser.js gatsby-config.js gatsby-node.js gatsby-ssr.js LICENSE package.json README.md yarn-error.log yarn.lock
困っていること
gatsbyのディレクトリごとさくらvpsに立てたリモートリポジトリにpushして公開ディレクトリからpullして、publicフォルダのみを公開すれば良いと思っていたのですが、publicフォルダは.gitignore
で除外している為gitで管理されていません。
publicディレクトリをgitで管理するのもどうかと思い、何か良い方法がないかとこちらで質問させていただきました。
ビルドしたpublicディレクトリをさくらvpsの公開ディレクトリにデプロイする良い方法があれば教えていただきたいです。よろしくおねがいします!
gitignore
1# Logs 2logs 3*.log 4npm-debug.log* 5yarn-debug.log* 6yarn-error.log* 7 8# Runtime data 9pids 10*.pid 11*.seed 12*.pid.lock 13 14# Directory for instrumented libs generated by jscoverage/JSCover 15lib-cov 16 17# Coverage directory used by tools like istanbul 18coverage 19 20# nyc test coverage 21.nyc_output 22 23# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24.grunt 25 26# Bower dependency directory (https://bower.io/) 27bower_components 28 29# node-waf configuration 30.lock-wscript 31 32# Compiled binary addons (http://nodejs.org/api/addons.html) 33build/Release 34 35# Dependency directories 36node_modules/ 37jspm_packages/ 38 39# Typescript v1 declaration files 40typings/ 41 42# Optional npm cache directory 43.npm 44 45# Optional eslint cache 46.eslintcache 47 48# Optional REPL history 49.node_repl_history 50 51# Output of 'npm pack' 52*.tgz 53 54# dotenv environment variables file 55.env 56 57# gatsby files 58.cache/ 59public 60 61# Mac files 62.DS_Store 63 64# Yarn 65yarn-error.log 66.pnp/ 67.pnp.js 68# Yarn Integrity file 69.yarn-integrity 70 71# 環境変数 72.env.development 73.env.production
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/06/17 03:07