LoginSignup
1
3

More than 3 years have passed since last update.

herokuでLPを無料で公開する方法

Last updated at Posted at 2020-05-20

この記事について

htmlファイルをherokuでデプロイしようと思った時、あれ?できない。。。となったので備忘録として手順を振り返りつつ残しておきたいので記事にしました。

参考記事

・HTMLページをHerokuにデプロイ
https://qiita.com/Hai-dozo/items/f0829dd121f477754b98
こちらの記事はとてもわかりやすく書いてます。

開発環境

・Mac Pro
・Herokuアカウントがあること
・PHPがローカルにインストールされていること
・Composerがローカルにインストールされていること
・githubにファイル登録済み

1.自分のLPファイルにindex.php,package.jsonを追加 以下の内容を入れておく

index.php
<?php include_once("index.html"); ?>
package.json
{}

2.herokuにログイン

heroku login

3.herokuでアプリを作成するか追加する、その後確認

heroku create アプリ名 or git remote add heroku 作成したherokuアプリのurl
git remote -v

origin と herokuが作成されていたら完了です。

4.gitとherokuにpushする

git add .
git commit -m "コメント"
git push origin master
git push heroku master

5.herokuにデプロイされたか確認

heroku ps:scale web=1
heroku open

これで画面が正常にでたら完了です。

6.最後に

以上がhtmlファイルをherokuにアップする備忘録でした。
デプロイ作業はどこがミスしてるかわかりにくいので振り返りに使おうと思います。

1
3
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3