Skip to content

Commit

Permalink
fix(readme): update access token instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
brettstack committed Apr 14, 2020
1 parent c82ce75 commit 94e5904
Showing 3 changed files with 34 additions and 29 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -8,16 +8,19 @@

A <a href="https://serverless.com/" target="_blank">Serverless Framework</a> plugin that enables you to easily host static websites with <a href="https://aws.amazon.com/amplify/console/" target="_blank">AWS Amplify Console</a> including Continuous Deployment in as few as 3 lines of YAML.

Developed and maintained by <a href="https://www.wizeline.com/" target="_blank">Wizeline</a>. Looking for a partner to help build your software or expand your existing team with veteran engineers, project managers, technical writers and more? Reach out to us at Wizeline.
Developed and maintained by <a href="https://www.wizeline.com/" target="_blank">Wizeline</a>. Wizeline understands that great software is built by great people and teams. If you’d like to partner with Wizeline to build your software or expand your existing team with veteran engineers, project managers, technical writers, <a href="https://www.wizeline.com/contact/" target="_blank">reach out to our team</a>.

## Usage

### Install @wizeline/serverless-amplify-plugin:

```shell
npm i -D @wizeline/serverless-amplify-plugin
```

### Create/update your `serverless.yaml`:

```yaml
# serverless.yaml
plugins:
- serverless-amplify-plugin

@@ -26,6 +29,7 @@ custom:
repository: https://github.com/USER/REPO # required
accessTokenSecretName: AmplifyGithub # optional
accessTokenSecretKey: accessToken # optional
accessToken: ... # 🔒 optional
branch: master # optional
domainName: example.com # optional;
buildSpec: |- # optional
@@ -38,7 +42,7 @@ custom:
preBuildWorkingDirectory: packages/ui # optional
```
### 🔒 Securing your GitHub Personal Access Token Secret
### 🔒 Create your GitHub Personal Access Token and store it AWS Secrets Manager
It's important **not** to paste your GitHub Personal Access Token directly into the `accessToken` property. At a minimum, you should use `${{env:GITHUB_PERSONAL_ACCESS_TOKEN}}` along with the <a href="serverless-dotenv-plugin" target="_blank">serverless-dotenv-plugin</a>, however, this will still be visible in the CloudFormation template and logs.

@@ -69,11 +73,11 @@ accessTokenSecretKey: personalAccessToken
**Default:** accessToken
### 🔒 accessToken (required*)
### 🔒 accessToken (optional)
A <a href="https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line" target="_blank">GitHub Personal Access Token</a> with `repo` permissions. Amplify Console sets up a <a href="https://developer.github.com/webhooks/" target="_blank">GitHub Webhook</a> so that it can be notified of new commits to build and deploy any changes.

🔒 This is a secret! It's recommended to store this in <a href="https://aws.amazon.com/secrets-manager/" target="_blank">AWS Secrets Manager</a>.
🔒 This is a secret! It's recommended to store your access token in <a href="https://aws.amazon.com/secrets-manager/" target="_blank">AWS Secrets Manager</a> and reference it in this property with `accessToken: '{{resolve:secretsmanager:AmplifyGithub:SecretString:accessToken}}'`. Alternatively, specify `accessTokenSecretName` and `accessTokenSecretKey` properties.

### branch (optional)

43 changes: 22 additions & 21 deletions examples/basic/public/index.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--

<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description"
content="Web set built using Serverless and @wizeline/serverless-amplify-plugin; hosted on AWS Amplify Console." />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
@@ -24,12 +23,13 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
<title>Wizeline Serverless Amplify Plugin</title>
</head>

<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
@@ -39,5 +39,6 @@
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
</body>

</html>
6 changes: 3 additions & 3 deletions examples/basic/public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"short_name": "WzlnSlsAmp",
"name": "Wizeline Serverless Amplify",
"icons": [
{
"src": "favicon.ico",
@@ -22,4 +22,4 @@
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
}

0 comments on commit 94e5904

Please sign in to comment.