![見出し画像](https://assets.st-note.com/production/uploads/images/7228614/rectangle_large_type_2_ab73dea0f20f7cc2e6dc42c858091c2a.jpg?width=1200)
Chromebookで作るPWAアプリ日記2
こんにちは、junkawaです。
今回は、GitHub PagesでPWAアプリを公開するための準備を行います。
目次
1. gitの設定
2. sshの設定
3. githubでリポジトリ作成
4. ローカルリポジトリで作業
1. gitの設定
$ pkg install git
gitをインストールします。
コミット時にメールアドレスを非公開にしたいので、上記の設定を行います。
2. sshの設定
githubへのアクセスはhttpsとsshが使えます。httpsでは毎回パスワードの入力が必要なので、今回はsshを使用します。
$ pkg install openssh
sshをインストールします。
ssh-keygenで鍵を生成し、githubに公開鍵を登録します。
3. githubでリポジトリ作成
今回は、リポジトリpwaを作成し、そのサブディレクトリで各アプリケーションを公開する予定です。https://<username>.github.io/pwa/<application name>/
github上でpwaリポジトリを作成します。
4. ローカルリポジトリで作業
$ mkdir github # 好きなディレクトリ名
$ cd github
$ git clone git@github.com:<username>/pwa.git # 自分のリポジトリ
$ cd pwa
pwaリポジトリをcloneします。
$ emacs .gitignore #*~を追加
$ git add .gitignore
$ git commit -m "added .gitignore"
$ git push
.gitignoreを追加します。
$ mkdir docs
$ emacs docs/index.html # 適当にhtmlファイルを作成
$ git add docs/index.html
$ git commit -m "added docs/index.html"
$ git push
docs/index.htmlを追加します。
masterブランチのdocs以下でGitHub Pagesを公開するように設定します。
これで、https://<username>.github.io/pwa/ にページが表示されるようになりました。
いいなと思ったら応援しよう!
![junkawa@Chromebookで始める開発日記](https://assets.st-note.com/production/uploads/images/6308616/profile_ab467878b52357bb7814fc31846ad584.jpg?width=600&crop=1:1,smart)