Skip to content

Commit

Permalink
react app uses NODE_ENV for calendar mode
Browse files Browse the repository at this point in the history
  • Loading branch information
lucia-gomez committed Mar 17, 2024
1 parent fc43ad0 commit e7e95fb
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/deploy_development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
branches:
- main

env:
REACT_APP_ENVIRONMENT: development

jobs:
deploy:
runs-on: ubuntu-latest
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/deploy_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,12 @@ on:
push:
branches:
- prod
env:
REACT_APP_ENVIRONMENT: production

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Debug env variable
run: |
echo "Environment variable: $REACT_APP_ENVIRONMENT"
- name: Checkout code
uses: actions/checkout@v2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,11 @@ const SAFTY_TRAINING_SHEET_NAME = 'safety_training_users';
const INSTANT_APPROVAL_ROOMS = ['220', '221', '222', '223', '224', '233'];

const SheetEditor = () => {
console.log(
'DEPLOY ENVIRONMENT:',
process.env.NODE_ENV,
process.env.REACT_APP_ENVIRONMENT,
process.env
);

const roomCalendarId = (room) => {
const roomById = findByRoomId(mappingRoomSettings, room.roomId);
if (roomById) {
console.log('ENVIRONMENT:', process.env.REACT_APP_ENVIRONMENT);
if (process.env.REACT_APP_ENVIRONMENT === 'production') {
console.log('ENVIRONMENT:', process.env.NODE_ENV);
if (process.env.NODE_ENV === 'production') {
return roomById.calendarIdProd;
} else {
return roomById.calendarId;
Expand Down

1 comment on commit e7e95fb

@lucia-gomez
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

#96

Please sign in to comment.