2
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 Actionsでデプロイして環境変数が読み込めずUncaught Error: supabaseUrl is required.

2
Posted at

はじめに

  • Github Actionsにアプリをデプロイ。環境変数はsecretの方ではなくフロントエンドのビルドに入っていい方のやつ。参照方法が分からなかったので確認した。

問題

  • 参照方法の間違いで環境変数が取得できていなかった

解決

  • 以下のようにスコープを指定して、vars.VITE_HOGEのようにして取得
jobs:
  deploy:
    runs-on: ubuntu-latest

    # https://github.com/username/reponame/settings/environments/hoge/edit で指定するスコープ名
    environment: development

    steps:
      - name: Checkout
        uses: actions/checkout@v6

      - name: Npm Build
        env:
          VITE_HOGE: ${{ vars.VITE_HOGE }}
        run: npm run build

終わりに

  • ここに取得方法が書いてある

2
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
2
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?