Skip to content

Conversation

@chelproc
Copy link
Contributor

概要

Repository variablesに設定されたGOOGLE_ANALYTICS_TRACKING_IDをGitHub Actionsのビルド時に環境変数として渡すように修正しました。

変更内容

  • .github/workflows/deploy.ymlのbuildステップにenvセクションを追加
  • ${{ vars.GOOGLE_ANALYTICS_TRACKING_ID }}を使用してRepository variablesから値を取得

背景

Repository variablesは自動的に環境変数として渡されないため、明示的に指定する必要があります。

- Pass repository variable GOOGLE_ANALYTICS_TRACKING_ID as environment variable during npm run build
- Configure Docusaurus to use Google Analytics when the environment variable is set
@cloudflare-workers-and-pages
Copy link

Deploying utcode-learn with  Cloudflare Pages  Cloudflare Pages

Latest commit: ab98cf7
Status: ✅  Deploy successful!
Preview URL: https://e1467ca1.utcode-learn.pages.dev
Branch Preview URL: https://add-google-analytics-env-var.utcode-learn.pages.dev

View logs

@chelproc chelproc requested a review from chvmvd July 11, 2025 11:10
Copy link
Contributor

@chvmvd chvmvd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@chelproc chelproc merged commit f944689 into main Jul 13, 2025
3 checks passed
@chelproc chelproc deleted the add-google-analytics-env-var branch July 13, 2025 05:04
@chvmvd chvmvd mentioned this pull request Aug 9, 2025
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants