From 1e913e776032155549d25d41c600887f7269ac30 Mon Sep 17 00:00:00 2001 From: Ruidy Date: Sat, 16 May 2020 15:58:04 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20Firebase=20hosting=20(#8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * init Firebase * add release step to github actions * fix syntax error * fix syntax error #2 * fix syntax error #3 * untrack firebase config files --- .github/workflows/deploy.yml | 13 ++++ .gitignore | 6 +- cypress/fixtures/example.json | 5 -- firestore.indexes.json | 117 ++++++++++++++++++++++++++++++++++ tslint.json | 63 ++++++++++++++++++ 5 files changed, 198 insertions(+), 6 deletions(-) delete mode 100644 cypress/fixtures/example.json create mode 100644 firestore.indexes.json create mode 100644 tslint.json diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 58b004e..d5bbf6d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -25,3 +25,16 @@ jobs: with: start: yarn start wait-on: 'http://localhost:3000' + release: + if: ${{ github.ref == 'master' }} + needs: test + name: Release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Build + run: yarn build + - name: Install Firebase CLI tools + run: yarn global add firebase-tools + - name: Deploy + run: firebase deploy --token ${{ secrets.FIREBASE_TOKEN }} diff --git a/.gitignore b/.gitignore index bff4ddb..fd4d212 100644 --- a/.gitignore +++ b/.gitignore @@ -27,4 +27,8 @@ npm-debug.log* yarn-debug.log* yarn-error.log* -.env \ No newline at end of file +.env +.firebase +firebase*json +*rules +.firebaserc \ No newline at end of file diff --git a/cypress/fixtures/example.json b/cypress/fixtures/example.json deleted file mode 100644 index da18d93..0000000 --- a/cypress/fixtures/example.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "Using fixtures to represent data", - "email": "hello@cypress.io", - "body": "Fixtures are a great way to mock data for responses to routes" -} \ No newline at end of file diff --git a/firestore.indexes.json b/firestore.indexes.json new file mode 100644 index 0000000..0b113bd --- /dev/null +++ b/firestore.indexes.json @@ -0,0 +1,117 @@ +{ + "indexes": [ + { + "collectionGroup": "restaurants", + "queryScope": "COLLECTION", + "fields": [ + { + "fieldPath": "category", + "order": "ASCENDING" + }, + { + "fieldPath": "avgRating", + "order": "DESCENDING" + } + ] + }, + { + "collectionGroup": "restaurants", + "queryScope": "COLLECTION", + "fields": [ + { + "fieldPath": "category", + "order": "ASCENDING" + }, + { + "fieldPath": "numRatings", + "order": "DESCENDING" + } + ] + }, + { + "collectionGroup": "restaurants", + "queryScope": "COLLECTION", + "fields": [ + { + "fieldPath": "category", + "order": "ASCENDING" + }, + { + "fieldPath": "price", + "order": "ASCENDING" + } + ] + }, + { + "collectionGroup": "restaurants", + "queryScope": "COLLECTION", + "fields": [ + { + "fieldPath": "city", + "order": "ASCENDING" + }, + { + "fieldPath": "avgRating", + "order": "DESCENDING" + } + ] + }, + { + "collectionGroup": "restaurants", + "queryScope": "COLLECTION", + "fields": [ + { + "fieldPath": "city", + "order": "ASCENDING" + }, + { + "fieldPath": "numRatings", + "order": "DESCENDING" + } + ] + }, + { + "collectionGroup": "restaurants", + "queryScope": "COLLECTION", + "fields": [ + { + "fieldPath": "city", + "order": "ASCENDING" + }, + { + "fieldPath": "price", + "order": "ASCENDING" + } + ] + }, + { + "collectionGroup": "restaurants", + "queryScope": "COLLECTION", + "fields": [ + { + "fieldPath": "price", + "order": "ASCENDING" + }, + { + "fieldPath": "avgRating", + "order": "DESCENDING" + } + ] + }, + { + "collectionGroup": "restaurants", + "queryScope": "COLLECTION", + "fields": [ + { + "fieldPath": "price", + "order": "ASCENDING" + }, + { + "fieldPath": "numRatings", + "order": "DESCENDING" + } + ] + } + ], + "fieldOverrides": [] +} diff --git a/tslint.json b/tslint.json new file mode 100644 index 0000000..6af008b --- /dev/null +++ b/tslint.json @@ -0,0 +1,63 @@ +{ + "rules": { + "adjacent-overload-signatures": true, + "ban-comma-operator": true, + "no-namespace": true, + "no-parameter-reassignment": true, + "no-reference": true, + "no-unnecessary-type-assertion": true, + "label-position": true, + "no-conditional-assignment": true, + "no-construct": true, + "no-duplicate-super": true, + "no-duplicate-switch-case": true, + "no-duplicate-variable": [ + true, + "check-parameters" + ], + "no-shadowed-variable": true, + "no-empty": [ + true, + "allow-empty-catch" + ], + "no-floating-promises": true, + "no-implicit-dependencies": true, + "no-invalid-this": true, + "no-string-throw": true, + "no-unsafe-finally": true, + "no-void-expression": [ + true, + "ignore-arrow-function-shorthand" + ], + "no-duplicate-imports": true, + // Warn when an empty interface is defined. These are generally not useful. + "no-empty-interface": { + "severity": "warning" + }, + "no-import-side-effect": { + "severity": "warning" + }, + "no-var-keyword": { + "severity": "warning" + }, + "triple-equals": { + "severity": "warning" + }, + "deprecation": { + "severity": "warning" + }, + "prefer-for-of": { + "severity": "warning" + }, + "unified-signatures": { + "severity": "warning" + }, + "prefer-const": { + "severity": "warning" + }, + "trailing-comma": { + "severity": "warning" + } + }, + "defaultSeverity": "error" +} \ No newline at end of file