Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…skip ci]
  • Loading branch information
leomp12 committed Jun 12, 2021
1 parent 73c1345 commit 90dc583
Show file tree
Hide file tree
Showing 16 changed files with 7,084 additions and 1,230 deletions.
36 changes: 0 additions & 36 deletions .dependabot/config.yml

This file was deleted.

17 changes: 17 additions & 0 deletions .functions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## Deploy Storefront to Firebase

Pre-rendered views and assets to [Firebase Hosting](https://firebase.google.com/docs/hosting?hl=pt-br), non-pre-rendered views SSRed with [Cloud Functions](https://firebase.google.com/docs/functions) and cached (acting like ISG).

### Getting started

1. [Create a service account](https://console.cloud.google.com/iam-admin/serviceaccounts) for your Firebase project directly on Google Cloud Platform;
2. Generate and download a JSON key for the created account;
3. Add a _secret_ to your GitHub repository with name `GCP_ACCOUNT_KEY` and paste the key JSON;

#### Prepare CI files

4. Copy new build and deploy GitHub Actions workflow from `.github/workflows/.firebase/build-and-deploy.yml` to `.github/workflows/build-and-deploy.yml`;

```bash
mv ./.github/workflows/.firebase/build-and-deploy.yml ./.github/workflows/build-and-deploy.yml
```
7 changes: 7 additions & 0 deletions .functions/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const functions = require('firebase-functions')

const { ssr } = require('@ecomplus/storefront-renderer/functions/')

process.env.STOREFRONT_LONG_CACHE = 'true'

exports.ssr = functions.https.onRequest((req, res) => ssr(req, res))
Loading

0 comments on commit 90dc583

Please sign in to comment.