Skip to content

Commit

Permalink
REACT_APPを撲滅
Browse files Browse the repository at this point in the history
  • Loading branch information
syou6162 committed Jan 14, 2023
1 parent 936e673 commit 2a94dfb
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
16 changes: 8 additions & 8 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
REACT_APP_API_KEY=""
REACT_APP_AUTH_DOMAIN=""
REACT_APP_PROJECT_ID=""
REACT_APP_STORAGE_BUCKET=""
REACT_APP_MESSAGING_SENDER_ID=""
REACT_APP_APP_ID=""
REACT_APP_MEASUREMENT_ID=""
VITE_API_KEY=""
VITE_AUTH_DOMAIN=""
VITE_PROJECT_ID=""
VITE_STORAGE_BUCKET=""
VITE_MESSAGING_SENDER_ID=""
VITE_APP_ID=""
VITE_MEASUREMENT_ID=""

REACT_APP_VALID_MAIL_ADDRESSES=""
VITE_VALID_MAIL_ADDRESSES=""
16 changes: 8 additions & 8 deletions .github/workflows/deploy_firebase_hosting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ jobs:
- run: npm install
- name: Build React app
env:
REACT_APP_API_KEY: ${{ secrets.REACT_APP_API_KEY }}
REACT_APP_AUTH_DOMAIN: ${{ secrets.REACT_APP_AUTH_DOMAIN }}
REACT_APP_PROJECT_ID: ${{ secrets.REACT_APP_PROJECT_ID }}
REACT_APP_STORAGE_BUCKET: ${{ secrets.REACT_APP_STORAGE_BUCKET }}
REACT_APP_MESSAGING_SENDER_ID: ${{ secrets.REACT_APP_MESSAGING_SENDER_ID }}
REACT_APP_APP_ID: ${{ secrets.REACT_APP_APP_ID }}
REACT_APP_MEASUREMENT_ID: ${{ secrets.REACT_APP_MEASUREMENT_ID }}
REACT_APP_VALID_MAIL_ADDRESSES: ${{ secrets.REACT_APP_VALID_MAIL_ADDRESSES }}
VITE_API_KEY: ${{ secrets.VITE_API_KEY }}
VITE_AUTH_DOMAIN: ${{ secrets.VITE_AUTH_DOMAIN }}
VITE_PROJECT_ID: ${{ secrets.VITE_PROJECT_ID }}
VITE_STORAGE_BUCKET: ${{ secrets.VITE_STORAGE_BUCKET }}
VITE_MESSAGING_SENDER_ID: ${{ secrets.VITE_MESSAGING_SENDER_ID }}
VITE_APP_ID: ${{ secrets.VITE_APP_ID }}
VITE_MEASUREMENT_ID: ${{ secrets.VITE_MEASUREMENT_ID }}
VITE_VALID_MAIL_ADDRESSES: ${{ secrets.VITE_VALID_MAIL_ADDRESSES }}
run: npm run-script build
- name: Setup Firebase CLI
run: npm install -g firebase-tools
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slackの分報likeに投稿しつつ、検索しやすいようにesa.ioに投
- Firebaseを中心に使っています
- APIKEYなどの情報を`.env`に記述しましょう
- [サンプルファイル](.env.sample)があります
- `REACT_APP_VALID_MAIL_ADDRESSES`は閲覧や書き込みを許可したいユーザーのメールアドレスです
- `VITE_VALID_MAIL_ADDRESSES`は閲覧や書き込みを許可したいユーザーのメールアドレスです
- `npm run-script start`で起動します

### backend
Expand Down
2 changes: 1 addition & 1 deletion src/components/Footer/index.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process.env.REACT_APP_VALID_MAIL_ADDRESSES = 'valid@example.com';
import.meta.env.VITE_VALID_MAIL_ADDRESSES = 'valid@example.com';

import { render } from '@testing-library/react'
import '@testing-library/jest-dom'
Expand Down
2 changes: 1 addition & 1 deletion src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ export type GoogleUser = {
}

export const isValidEmail = (email: string): boolean => {
return email === process.env.REACT_APP_VALID_MAIL_ADDRESSES;
return email === import.meta.env.VITE_VALID_MAIL_ADDRESSES;
};

0 comments on commit 2a94dfb

Please sign in to comment.