Skip to content

Commit

Permalink
setup firebase files (#149)
Browse files Browse the repository at this point in the history
* setup firebase files

* update pr action

* add default dir

* update build script

* add entry point

* update yml for heroku deploy

---------

Co-authored-by: Safewaan <[email protected]>
  • Loading branch information
Safewaan and Safewaan authored Jul 25, 2023
1 parent 8e995a3 commit 995405b
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 22 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: echo "REACT_APP_BACKEND_URL=${{ secrets.DEV_BACKEND_URL }}" > .env
auth {
- run: echo "REACT_APP_OAUTH_CLIENT_ID=${{ secrets.DEV_OAUTH_CLIENT_ID }}" >> .env
} auth
- run: rm -rf node_modules && yarn install --frozen-lockfile && yarn build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
Expand Down
22 changes: 8 additions & 14 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy frontend to Firebase Hosting preview

on:
pull_request:
paths:
- "frontend/**"
name: Deploy to Firebase Hosting on PR
"on": pull_request

defaults:
run:
working-directory: frontend

jobs:
build_and_preview:
if: "${{ github.event.pull_request.head.repo.full_name == github.repository && github.base_ref == 'main' }}"
if: "${{ github.event.pull_request.head.repo.full_name == github.repository }}"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: echo "REACT_APP_BACKEND_URL=${{ secrets.PREVIEW_BACKEND_URL }}" > .env
auth {
- run: echo "REACT_APP_OAUTH_CLIENT_ID=${{ secrets.DEV_OAUTH_CLIENT_ID }}" >> .env
} auth
- run: rm -rf node_modules && yarn install --frozen-lockfile && yarn build
- run: |
export NODE_OPTIONS="--max_old_space_size=4096"
rm -rf node_modules && yarn install && yarn build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_UW_BLUEPRINT_STARTER_CODE }}"
projectId: "${{ secrets.DEV_PROJECT_ID }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_BLUEPRINTSUPPORTIVEHOUSING }}"
projectId: blueprintsupportivehousing
entryPoint: ./frontend
1 change: 0 additions & 1 deletion .github/workflows/heroku-deploy-dev-py.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:

jobs:
deploy:
if: ${{ false }}
runs-on: ubuntu-latest
steps:
- name: Check out repository
Expand Down
6 changes: 3 additions & 3 deletions backend/app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ def create_app(config_name="development"):

app.config["CORS_ORIGINS"] = [
"http://localhost:3000",
"https://uw-blueprint-starter-code.firebaseapp.com",
"https://uw-blueprint-starter-code.web.app",
re.compile("^https:\/\/uw-blueprint-starter-code--pr.*\.web\.app$"),
"https://blueprint-supportive-housing.firebaseapp.com",
"https://blueprint-supportive-housing.web.app",
re.compile("^https:\/\/blueprint-supportive-housing--pr.*\.web\.app$"),
]
app.config["CORS_SUPPORTS_CREDENTIALS"] = True
CORS(app)
Expand Down
2 changes: 1 addition & 1 deletion frontend/.firebaserc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"projects": {
"default": "uw-blueprint-starter-code"
"default": "blueprintsupportivehousing"
}
}
66 changes: 66 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
firebase-debug.log*
firebase-debug.*.log*

# Firebase cache
.firebase/

# Firebase config

# Uncomment this if you'd like others to create their own Firebase project.
# For a team working on the same Firebase project(s), it is recommended to leave
# it commented so all members can deploy to the same project(s) in .firebaserc.
# .firebaserc

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"build": "react-scripts --openssl-legacy-provider build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"lint": "eslint . --ext .ts,.tsx,.js,.jsx",
Expand Down

0 comments on commit 995405b

Please sign in to comment.