https://github.com/mearns/wood-smith-gaction
A google actions project for help with wood working
https://github.com/mearns/wood-smith-gaction
Last synced: about 1 month ago
JSON representation
A google actions project for help with wood working
- Host: GitHub
- URL: https://github.com/mearns/wood-smith-gaction
- Owner: mearns
- Created: 2021-01-13T19:25:44.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-02-04T22:09:20.000Z (about 4 years ago)
- Last Synced: 2025-02-05T11:45:04.161Z (3 months ago)
- Language: JavaScript
- Size: 721 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Wood Smith 2 Google Actions Project
## Development
Quick overview: We use Google Actions SDK to define our scenes, intents, types, etc., which is basically
the dialog pattern for the Google Assistant. These are defined in the `sdk/` directory. Some of these are
configured to delegate to a webhook to do some work. We're deploying
firebase functions to serve those webhooks. The entire firebase application is the root project directory,
but the webhook functions are defined specifically as "Firebase Functions", under the `functions/`
directory.The files for the Google Action SDK are _generated_ from the files in `sdk/`, but should be deployed
from `build/sdk/`, which is generated by running `npm run generate`. This scans the files in `sdk/`
and copies YAML files over verbatim, but import any JS files it finds and generates a corresponding
YAML file from the default export of the module.This is all one google-cloud project called
["the-woodshop-helper"](https://console.cloud.google.com/home/dashboard?folder=&organizationId=0&project=the-woodshop-helper)
(id is also "the-woodshop-helper").The "Actions on Google" (aka "gactions") part can be viewed in the
[Actions on Google web console here](https://console.actions.google.com/u/0/project/the-woodshop-helper).The Backend stuff can be viewed in [Firebase](https://console.firebase.google.com/u/0/project/the-woodshop-helper).
### Deploy Google Actions
```console
$ npm run generate
$ npm run publish:gactions
```You need to have the gactions-cli installed.
### Deploy Firebase Functions
```console
$ npm run deploy:firebase
```Firebase console is here: https://console.firebase.google.com/u/0/
### Run Firebase Locally
```console
$ npm run firebase-emulate
```## How To
### Rename the Action
Google Actions has a lot of rules about what you can name an action, and they're subject to human review
after you submit it.If you need to change the name of just the action, you can do that in
`sdk/settings/settings.yaml`. You'll need to change `displayName`, and then change the `pronounciation`
to match (and make sure to test this in the gactions console). You'll also need to update the name in the
title and body of the privacy policy, linked from `privacyPolicyUrl` (the URL should stay the same if you're
just editing the google docs document).If you want to change the project name to match, it's a bit more involved. You'll need to create a new google
cloud project, and set it's projectId in `sdk/settings/settings.yaml` and `.firebaserc`. After deploying the new
Firebase project, you'll also need to get the URL for the Firebase function and set it in the
`sdk/webhooks/ActionsOnGoogleFulfillment.yaml` file. You might also want to change the name in package.json,
and maybe the name of the github repo.