私は、私のオープンソースプロジェクトをherokuにデプロイしようとしています。 しかし、彼らは静的なサイトをサポートしていないのでしょうか? htmlとjavascript以外を使う予定がないのであれば、Sinatraプロジェクトにするのは避けたいです。
~/sites/d4-site $ heroku create --stack cedar
Creating quiet-ice-4769... done, stack is cedar
http://quiet-ice-4769.herokuapp.com/ | [email protected]:quiet-ice-4769.git
Git remote heroku added
~/sites/d4-site $ git remote -v
heroku [email protected]:quiet-ice-4769.git (fetch)
heroku [email protected]:quiet-ice-4769.git (push)
~/sites/d4-site $ git push heroku master
Counting objects: 53, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (49/49), done.
Writing objects: 100% (53/53), 206.08 KiB, done.
Total 53 (delta 4), reused 0 (delta 0)
-----> Heroku receiving push
-----> Removing .DS_Store files
! Heroku push rejected, no Cedar-supported app detected
簡単な方法としては、HTMLアプリをPHPアプリに見せかけてしまうことです。 HerokuはPHPアプリを適切に識別します。
1.1. index.html ファイルを home.html にリネームします。 2.2. index.php ファイルを作成し、エントリ html ファイルをインクルードします。エントリーHTMLファイルの名前を推奨通りhome.htmlとした場合、index.phpは以下のような表示になるはずです。
php include_once("home.html"); ?>`)
3.3. 実行するマシンのコマンドラインで、次のように入力します。
git add . git commit -m 'あなたのコミットメッセージ' git push heroku master` とします。
Herokuは、あなたのアプリをPHPアプリとして適切に検出するはずです。
-----> PHP app detected
-----> Bundling Apache version 2.2.22
-----> Bundling PHP version 5.3.10
-----> Discovering process types
Procfile declares types -> (none)
Default types for PHP -> web
-----> Compiled slug size: 9.9MB
-----> Launching... done, v3
...
Mad lemiffe氏のブログ記事に感謝します。http://www.lemiffe.com/how-to-deploy-a-static-page-to-heroku-the-easy-way/
ラックを使って行うことができます。
https://devcenter.heroku.com/articles/static-sites-on-heroku
または、Octopress / Jekyllのようなものを使用することができます 誰がsinatraを使用しています。
しかし、あなたは、HTMLの静的なコンテンツを提供するための最小限のスタックが必要です。