Skip to content

Commit

Permalink
Merge branch 'release/2.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
dlubawy committed Dec 21, 2021
2 parents 1537c44 + 91d6b59 commit 1781529
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 11 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on merge
'on':
push:
branches:
- main
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm ci && npm run build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_MYSITE_1383 }}'
channelId: live
projectId: mysite-1383
17 changes: 17 additions & 0 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on PR
'on': pull_request
jobs:
build_and_preview:
if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm ci && npm run build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_MYSITE_1383 }}'
projectId: mysite-1383
10 changes: 10 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,22 @@
"**/node_modules/**"
]
},
"firestore": {
"rules": ".firebase/firestore.rules"
},
"emulators": {
"hosting": {
"port": 5000
},
"ui": {
"enabled": true
},
"auth": {
"port": 9099
},
"firestore": {
"port": 8080,
"host": "127.0.0.1"
}
}
}
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mysite",
"version": "2.0.3",
"version": "2.1.0",
"private": true,
"scripts": {
"serve": "npm run build:dev && (npm run build:watch & npm run serve:firebase)",
Expand Down
3 changes: 3 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ import ContactForm from "./components/ContactForm.vue";
import { auth, analytics } from "./firebaseConfig.js";
import { logEvent } from "firebase/analytics";
import { signInAnonymously } from "firebase/auth";
signInAnonymously(auth);
var tag = document.URL.split("#")[1];
if (tag == null) {
Expand Down
14 changes: 11 additions & 3 deletions src/firebaseConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ const firebaseConfig = {
const app = initializeApp(firebaseConfig);
const analytics = getAnalytics(app);

const auth = getAuth(app);
const db = getFirestore(app);

if (process.env.NODE_ENV === "development") {
const emulators = require("./firebaseEmulators.js");

emulators.connectFirestoreEmulator(db, "localhost", 8080);
emulators.connectAuthEmulator(auth, "http://localhost:9099");
self.FIREBASE_APPCHECK_DEBUG_TOKEN = process.env.VUE_APP_CHECK;
}

const appCheck = initializeAppCheck(app, {
provider: new ReCaptchaV3Provider("6LcOyLQdAAAAAML71Vv35GBYNIoXtrQnAAQudkvK"),

Expand All @@ -31,7 +42,4 @@ const appCheck = initializeAppCheck(app, {
isTokenAutoRefreshEnabled: true,
});

const auth = getAuth(app);
const db = getFirestore(app);

export { analytics, appCheck, auth, db };
4 changes: 4 additions & 0 deletions src/firebaseEmulators.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { connectFirestoreEmulator } from "firebase/firestore";
import { connectAuthEmulator } from "firebase/auth";

export { connectFirestoreEmulator, connectAuthEmulator };
5 changes: 0 additions & 5 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@ import App from "./App.vue";
import "bootstrap";
import "bootswatch/dist/sandstone/bootstrap.min.css";

import { auth } from "./firebaseConfig.js";
import { signInAnonymously } from "firebase/auth";

Vue.config.productionTip = false;

signInAnonymously(auth);

new Vue({
render: (h) => h(App),
}).$mount("#app");

0 comments on commit 1781529

Please sign in to comment.