Skip to content

Commit

Permalink
Add local variables (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryczko authored Feb 19, 2023
1 parent 7a39603 commit db5bd8d
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 12 deletions.
7 changes: 7 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
NEXT_PUBLIC_API_KEY=
NEXT_PUBLIC_AUTH_DOMAIN=
NEXT_PUBLIC_PROJECT_ID=
NEXT_PUBLIC_STORAGE_BUCKET=
NEXT_PUBLIC_MESSAGING_SENDER_ID=
NEXT_PUBLIC_APP_ID=
NEXT_PUBLIC_MEASUREMENT_ID=
18 changes: 14 additions & 4 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,35 @@

name: Node.js CI

on: [push]
on:
push:
branches:
- main
- '*'

jobs:
build:
runs-on: ubuntu-latest

environment: ${{ github.ref == 'refs/heads/main' && 'production' || 'preview'}}
strategy:
matrix:
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
env:
CI: 1
NEXT_PUBLIC_API_KEY: ${{ secrets.NEXT_PUBLIC_API_KEY }}
NEXT_PUBLIC_AUTH_DOMAIN: ${{ secrets.NEXT_PUBLIC_AUTH_DOMAIN }}
NEXT_PUBLIC_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_PROJECT_ID }}
NEXT_PUBLIC_STORAGE_BUCKET: ${{ secrets.NEXT_PUBLIC_STORAGE_BUCKET }}
NEXT_PUBLIC_MESSAGING_SENDER_ID: ${{ secrets.NEXT_PUBLIC_MESSAGING_SENDER_ID }}
NEXT_PUBLIC_APP_ID: ${{ secrets.NEXT_PUBLIC_APP_ID }}
NEXT_PUBLIC_MEASUREMENT_ID: ${{ secrets.NEXT_PUBLIC_MEASUREMENT_ID }}
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache: 'npm'
- run: npm ci
- run: npm run build
- run: npm run test-ci
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
Expand Down
29 changes: 21 additions & 8 deletions src/firebase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,22 @@ import {
import { getFirestore, getDoc, setDoc, doc } from 'firebase/firestore';

const firebaseConfig = {
apiKey: 'AIzaSyD1Y1Jb33a-DecxVe64bcIymPTpK-rzA7g',
authDomain: 'employee-pulse-b2d2e.firebaseapp.com',
projectId: 'employee-pulse-b2d2e',
storageBucket: 'employee-pulse-b2d2e.appspot.com',
messagingSenderId: '964138853453',
appId: '1:964138853453:web:b5de62a8a7053f09e52804',
measurementId: 'G-J4KXG6KY31',
apiKey:
process.env.NEXT_PUBLIC_API_KEY ||
'AIzaSyD1Y1Jb33a-DecxVe64bcIymPTpK-rzA7g',
authDomain:
process.env.NEXT_PUBLIC_AUTH_DOMAIN ||
'employee-pulse-b2d2e.firebaseapp.com',
projectId: process.env.NEXT_PUBLIC_PROJECT_ID || 'employee-pulse-b2d2e',
storageBucket:
process.env.NEXT_PUBLIC_STORAGE_BUCKET ||
'employee-pulse-b2d2e.appspot.com',
messagingSenderId:
process.env.NEXT_PUBLIC_MESSAGING_SENDER_ID || '964138853453',
appId:
process.env.NEXT_PUBLIC_APP_ID ||
'1:964138853453:web:b5de62a8a7053f09e52804',
measurementId: process.env.NEXT_PUBLIC_MEASUREMENT_ID || 'G-J4KXG6KY31',
};

const app = initializeApp(firebaseConfig);
Expand Down Expand Up @@ -73,7 +82,11 @@ const logInWithEmailAndPassword = async (email: string, password: string) => {
}
};

const registerWithEmailAndPassword = async (name: string, email: string, password: string) => {
const registerWithEmailAndPassword = async (
name: string,
email: string,
password: string
) => {
try {
const res = await createUserWithEmailAndPassword(auth, email, password);
const user = res.user;
Expand Down

0 comments on commit db5bd8d

Please sign in to comment.