LoginSignup
1
0

More than 1 year has passed since last update.

Netlifyでステージング環境へデプロイしたい

Posted at

Netlify で本番環境とは別のステージング環境へデプロイする時の設定を、忘れないうちにメモとして残します。

Deploy contextsBranches に命名変更したっぽい

軽く検索してみると、 Deploy contexts という機能を紹介しているページをいくつか見かけるのですが、Netlify の設定項目を見渡しても、その機能を見つけることができません。

よくよく調べると、どうやら Branches という名前に変わっていることがわかりました。

image.png

Let me add individual branches を選択する

Branch deploys という項目が、初期状態だと None になっていますが、これを Let me add individual branches に変更します。

これは ブランチを個別に指定する みたいな意味です。

そうすると、 Additional branches という入力欄が現れます。

Additional branches にブランチ名を入力する

Additional branches にお好きなブランチ名を入力します。

図では staging と入力しています。

これは、 staging ブランチが更新されたら、デプロイするという意味です。

ステージング環境のデプロイ先

本番環境の URL の先頭に ブランチ名-- を付けたものが、デプロイ先になります。

例:

環境 デプロイ先
本番環境 xxxxxx-xxxxxx-xxxxxx.netlify.com
ステージング環境 staging--xxxxxx-xxxxxx-xxxxxx.netlify.com

さいごに

本記事作成にあたり、以下のサイトを参考にさせていただきました。ありがとうございました!

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