Skip to content

Commit e790d89

Browse files
author
Bart Hazen
committed
Set up automatic deployment when pushed to master.
1 parent fc52b54 commit e790d89

File tree

4 files changed

+82
-24
lines changed

4 files changed

+82
-24
lines changed

.firebaserc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"projects": {
3+
"default": "python-create"
4+
}
5+
}

.github/workflows/deploy.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Build and Deploy
2+
on:
3+
push:
4+
branches: [ master ]
5+
pull_request:
6+
branches: [ master ]
7+
8+
jobs:
9+
build:
10+
name: Build
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repo
14+
uses: actions/checkout@master
15+
- name: Install dependencies
16+
run: npm install
17+
- name: Fix vulnerabilities
18+
run: npm audit fix
19+
- name: Build
20+
run: npm run build
21+
- name: Archive production artifact
22+
uses: actions/upload-artifact@master
23+
with:
24+
name: build
25+
path: build
26+
deploy:
27+
name: Deploy
28+
needs: build
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout repo
32+
uses: actions/checkout@master
33+
- name: Download Artifact
34+
uses: actions/download-artifact@master
35+
with:
36+
name: build
37+
path: build
38+
- name: Deploy to Firebase
39+
uses: w9jds/firebase-action@master
40+
with:
41+
args: deploy --only hosting
42+
env:
43+
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}

firebase.json

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,10 @@
11
{
2-
"database": {
3-
"rules": "database.rules.json"
4-
},
52
"hosting": {
63
"public": "build",
74
"ignore": [
85
"firebase.json",
96
"**/.*",
107
"**/node_modules/**"
11-
],
12-
"rewrites": [
13-
{
14-
"source": "**",
15-
"destination": "/index.html"
16-
}
178
]
18-
},
19-
"storage": {
20-
"rules": "storage.rules"
21-
},
22-
"emulators": {
23-
"functions": {
24-
"port": 5001
25-
},
26-
"database": {
27-
"port": 9000
28-
},
29-
"hosting": {
30-
"port": 5000
31-
}
329
}
33-
}
10+
}

public/404.html

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>Page Not Found</title>
7+
8+
<style media="screen">
9+
body { background: #ECEFF1; color: rgba(0,0,0,0.87); font-family: Roboto, Helvetica, Arial, sans-serif; margin: 0; padding: 0; }
10+
#message { background: white; max-width: 360px; margin: 100px auto 16px; padding: 32px 24px 16px; border-radius: 3px; }
11+
#message h3 { color: #888; font-weight: normal; font-size: 16px; margin: 16px 0 12px; }
12+
#message h2 { color: #ffa100; font-weight: bold; font-size: 16px; margin: 0 0 8px; }
13+
#message h1 { font-size: 22px; font-weight: 300; color: rgba(0,0,0,0.6); margin: 0 0 16px;}
14+
#message p { line-height: 140%; margin: 16px 0 24px; font-size: 14px; }
15+
#message a { display: block; text-align: center; background: #039be5; text-transform: uppercase; text-decoration: none; color: white; padding: 16px; border-radius: 4px; }
16+
#message, #message a { box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); }
17+
#load { color: rgba(0,0,0,0.4); text-align: center; font-size: 13px; }
18+
@media (max-width: 600px) {
19+
body, #message { margin-top: 0; background: white; box-shadow: none; }
20+
body { border-top: 16px solid #ffa100; }
21+
}
22+
</style>
23+
</head>
24+
<body>
25+
<div id="message">
26+
<h2>404</h2>
27+
<h1>Page Not Found</h1>
28+
<p>The specified file was not found on this website. Please check the URL for mistakes and try again.</p>
29+
<h3>Why am I seeing this?</h3>
30+
<p>This page was generated by the Firebase Command-Line Interface. To modify it, edit the <code>404.html</code> file in your project's configured <code>public</code> directory.</p>
31+
</div>
32+
</body>
33+
</html>

0 commit comments

Comments
 (0)