0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

GitHub リポジトリと Cloudflare Pages を連携し、Next.js アプリのCI/CDパイプラインを構築

Posted at

記事の経緯

内容はネット上によくありますが、
GitHub経由でホスティングするしない方法と混同してつまづいたので備忘。

順番

  1. Next.JSでアプリをつくる。
    (GitHub Flavored Markdown Specにもとづいてマークダウンチェックしてくれるアプリを作りました。)
  2. buildできるような状態にして、
    npm install --save--dev @opennextjs/cloudflareコマンドする。(ここもしかしたらいらないかも)
  3. GitHubでリポジトリにPUSHする。
  4. CloudflareのWorkers&Pagesページの新規作成から、GitHubリポジトリを選択して作成。(この辺は内容割愛。)
  5. 一回deployして、エラーが出るので、Settingsから
  • Variables and Secretsで実際のプロジェクトのNODE_VERSIONを設定。
    (自分は20でした)
  • Compatibillity flagsをnodejs_compatを入力して登録。
    プルダウンでnodejs_compat_populate_process_env
    nodejs_compat_do_not_populate_process_envしか出てこなくてないやん、入力できんやん!で困った。(確かに最初入力できんかった気がするのだが、、)

image.png

image.png

おわりに

公式ドキュメントをだいぶ読んだので、いい経験になった。
markdownの書き方を理解したい。
これで再現性のないAIパワープレイホスティングでなくていろいろホスティングできるぞ。

参考にさせていただいた記事

Cloudflare公式ドキュメント

compatibilityのとこ

0
0
0

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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?