Add deploy-frontend target to Makefile#1529
Merged
Merged
Conversation
Build the frontend locally and sync the build artifacts to the S3 bucket that serves the site. The bucket is configurable via the S3_BUCKET variable (defaults to kenkoooo.com). --delete is intentionally omitted from the sync because the destination bucket also hosts backend-generated data (e.g. resources/) that is not part of the frontend build. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
フロントエンドをローカルでビルドし、サイトを配信している S3 バケットへ sync する
deploy-frontendサブコマンドを Makefile に追加しました。使い方
デフォルトの sync 先は
s3://kenkoooo.com/です。S3_BUCKET変数で上書きできます。実装メモ
atcoder-problems-frontendでpnpm install --frozen-lockfile && pnpm run buildを実行してから、build/をaws s3 syncします。aws s3 syncに--deleteは意図的に付けていません。配信バケットのルートにはフロントエンドのビルド成果物だけでなく、バックエンドが生成する API データ(resources/配下のac.json/contests.json等)も同居しているため、--deleteを付けるとそれらを削除してしまうためです。pnpm run buildはreact-scripts buildに加えてmdbookによるmd:build(guide/のドキュメント生成)も実行するため、ローカルにmdbookが必要です。動作確認
make -n deploy-frontendでレシピが期待通り展開されることを確認しました(実際のデプロイは未実行)。🤖 Generated with Claude Code