Skip to content

Commit

Permalink
use deploy mode env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
lucia-gomez committed Mar 16, 2024
1 parent c0e30e5 commit 252fe34
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 14 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/deploy_development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy DEVELOPMENT to Google Apps Script
on:
push:
branches:
- prod_dev
- main

jobs:
deploy:
Expand All @@ -18,6 +18,9 @@ jobs:
with:
node-version: "18"

- name: Set deploy mode environment variable
run: echo "REACT_APP_ENVIRONMENT=development" >> $GITHUB_ENV

- name: Install dependencies
run: |
cd media_commons_booking_app
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/deploy_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy to PRODUCTION to Google Apps Script
on:
push:
branches:
- main
- prod

jobs:
deploy:
Expand All @@ -18,6 +18,9 @@ jobs:
with:
node-version: "18"

- name: Set deploy mode environment variable
run: echo "REACT_APP_ENVIRONMENT=production" >> $GITHUB_ENV

- name: Install dependencies
run: |
cd media_commons_booking_app
Expand Down
18 changes: 14 additions & 4 deletions media_commons_booking_app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions media_commons_booking_app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.7",
"@types/expect-puppeteer": "^5.0.0",
"@types/jest-environment-puppeteer": "^5.0.2",
"@types/node": "^20.11.28",
"@types/puppeteer": "^5.4.6",
"@types/react": "^18.0.14",
"autoprefixer": "10.4.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,18 @@ const SAFTY_TRAINING_SHEET_NAME = 'safety_training_users';
const INSTANT_APPROVAL_ROOMS = ['220', '221', '222', '223', '224', '233'];

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

//DEV
//const roomCalendarId = (room) => {
// return findByRoomId(mappingRoomSettings, room.roomId)?.calendarId;
//};

const getActiveUserEmail = () => {
serverFunctions.getActiveUserEmail().then((response) => {
console.log('userEmail response', response);
Expand Down
2 changes: 1 addition & 1 deletion media_commons_booking_app/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"types": ["gas-types-detailed"],
"types": ["gas-types-detailed", "node"],
"jsx": "react",
"esModuleInterop": true,
"lib": ["esnext", "dom"]
Expand Down

0 comments on commit 252fe34

Please sign in to comment.