Skip to content

Commit

Permalink
Updating file for firebase hosting
Browse files Browse the repository at this point in the history
  • Loading branch information
baktiaditya committed Jun 6, 2021
1 parent 12263f4 commit d55cc10
Show file tree
Hide file tree
Showing 7 changed files with 3,778 additions and 77 deletions.
5 changes: 5 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "cother-8e4f9"
}
}
39 changes: 28 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# Expo
/.expo/*

# Expo Web
/web-build/*

# Expo Native
*.jks
*.p8
*.p12
*.key
*.mobileprovision
*.orig.*

# Next.js
/.next/*
/out/

# Next.js production
/build/

# dependencies
/node_modules
/.pnp
Expand All @@ -8,17 +29,6 @@
# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
Expand All @@ -32,3 +42,10 @@ yarn-error.log*

# vercel
.vercel

# Firebase
/.firebase/*

# misc
.DS_Store
*.pem
16 changes: 16 additions & 0 deletions firebase-hosting/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="refresh" content="0; url=https://cother.netlify.app/" />
<script type="text/javascript">
window.location.href = 'https://cother.netlify.app/';
</script>
<title>Cother</title>
</head>
<body>
<h1>Redirecting...</h1>
</body>
</html>
2 changes: 1 addition & 1 deletion firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"rules": "firebase.db.rules.json"
},
"hosting": {
"public": "build",
"public": "firebase-hosting",
"ignore": [
"firebase.json",
"index.tmpl.ejs",
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"dev": "next dev",
"build": "next build && next export",
"serve": "next start",
"serve-static": "serve -c serve.json"
"serve-static": "serve -c serve.json",
"deploy-firebase": "node run deploy"
},
"dependencies": {
"@emotion/react": "^11.4.0",
Expand Down Expand Up @@ -41,6 +42,7 @@
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "^7.23.2",
"firebase-tools": "^9.12.1",
"netlify-plugin-cache-nextjs": "^1.6.1",
"next-compose-plugins": "^2.2.1",
"next-images": "^1.7.0",
Expand Down
30 changes: 30 additions & 0 deletions run.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* eslint-disable no-console */
const firebase = require('firebase-tools');

const tasks = new Map(); // The collection of automation tasks ('build', 'publish', etc.)
function run(task) {
const start = new Date();
console.log(`${'\x1b[32m'}Starting "${task}"...${'\x1b[0m'}`);
return Promise.resolve()
.then(() => tasks.get(task)())
.then(
() => {
console.log(
`${'\x1b[32m'}Finished "${task}" after ${
new Date().getTime() - start.getTime()
}ms${'\x1b[0m'}`,
);
},
err => console.error(err.stack),
);
}

tasks.set('deploy', async () => {
return Promise.resolve()
.then(() => firebase.login({ nonInteractive: false }))
.then(() => firebase.deploy())
.then(() => console.log('Deployed to Firebase'));
});

// Execute the specified task. E.g.: node run build
run(/^\w/.test(process.argv[2] || '') && process.argv[2]);
Loading

0 comments on commit d55cc10

Please sign in to comment.