Skip to content

Commit 7f46a46

Browse files
committed
(chore) initializing repo
0 parents  commit 7f46a46

27 files changed

+11606
-0
lines changed

.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
indent_style = space
8+
indent_size = 2
9+
end_of_line = lf
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
[*.md]
14+
insert_final_newline = false
15+
trim_trailing_whitespace = false

.github/workflows/deploy.yaml

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# This GitHub Actions workflow runs on every push to the master branch of the
2+
# repository, and configures the React app in the AWS Amplify Console.
3+
#
4+
# First, the GitHub Action deploys the 'stack.yaml' AWS CloudFormation stack
5+
# to your AWS Account. This stack configures the React app in the AWS Amplify Console.
6+
#
7+
# Then, you need to trigger a first build in the AWS Amplify Console to
8+
# fully configure it.
9+
10+
on:
11+
push:
12+
branches:
13+
- master
14+
15+
name: Deploy
16+
17+
jobs:
18+
# Deploy the React app to AWS Amplify Console.
19+
# This job will run on every code change to the master branch, but will only deploy
20+
# changes if the infrastructure CloudFormation template in the repository changes.
21+
amplify:
22+
name: Deploy to Amplify Console
23+
runs-on: ubuntu-latest
24+
outputs:
25+
env-name: ${{ steps.env-name.outputs.environment }}
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v2
29+
30+
- name: Configure AWS credentials
31+
id: creds
32+
uses: aws-actions/configure-aws-credentials@v1
33+
with:
34+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
35+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
36+
aws-region: us-east-1
37+
38+
- name: Configure environment name
39+
id: env-name
40+
env:
41+
REPO: ${{ github.repository }}
42+
run: |
43+
ENVIRONMENT=`echo $REPO | tr "/" "-"`
44+
echo "Environment name: $ENVIRONMENT"
45+
echo "::set-output name=environment::$ENVIRONMENT"
46+
47+
- name: Deploy to Amplify Console with CloudFormation
48+
id: amplify-stack
49+
uses: aws-actions/aws-cloudformation-github-deploy@v1
50+
with:
51+
name: ${{ steps.env-name.outputs.environment }}
52+
template: stack.yaml
53+
no-fail-on-empty-changeset: "1"
54+
parameter-overrides: >-
55+
Name=${{ steps.env-name.outputs.environment }},
56+
Repository=https://github.com/${{ github.repository }},
57+
OauthToken=${{ secrets.AMPLIFY_TOKEN }},
58+
Domain=${{secrets.AMPLIFY_DOMAIN}}
59+
# When a domain is configured to the stack,
60+
# it gets configured in the environment and printed to the console.
61+
- name: Print default domain
62+
env:
63+
DefaultDomain: ${{ steps.amplify-stack.outputs.DefaultDomain }}
64+
run: |
65+
echo "Default Domain: $DefaultDomain"

.gitignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*

CODE_OF_CONDUCT.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
## Code of Conduct
2+
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
3+
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
4+
[email protected] with any additional questions or comments.

CONTRIBUTING.md

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Contributing Guidelines
2+
3+
Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional
4+
documentation, we greatly value feedback and contributions from our community.
5+
6+
Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
7+
information to effectively respond to your bug report or contribution.
8+
9+
10+
## Reporting Bugs/Feature Requests
11+
12+
We welcome you to use the GitHub issue tracker to report bugs or suggest features.
13+
14+
When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already
15+
reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
16+
17+
* A reproducible test case or series of steps
18+
* The version of our code being used
19+
* Any modifications you've made relevant to the bug
20+
* Anything unusual about your environment or deployment
21+
22+
23+
## Contributing via Pull Requests
24+
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
25+
26+
1. You are working against the latest source on the *master* branch.
27+
2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
28+
3. You open an issue to discuss any significant work - we would hate for your time to be wasted.
29+
30+
To send us a pull request, please:
31+
32+
1. Fork the repository.
33+
2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
34+
3. Ensure local tests pass.
35+
4. Commit to your fork using clear commit messages.
36+
5. Send us a pull request, answering any default questions in the pull request interface.
37+
6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
38+
39+
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
40+
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
41+
42+
43+
## Finding contributions to work on
44+
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start.
45+
46+
47+
## Code of Conduct
48+
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
49+
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
50+
[email protected] with any additional questions or comments.
51+
52+
53+
## Security issue notifications
54+
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
55+
56+
57+
## Licensing
58+
59+
See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
60+
61+
We may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes.

LICENSE

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of
4+
this software and associated documentation files (the "Software"), to deal in
5+
the Software without restriction, including without limitation the rights to
6+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
7+
the Software, and to permit persons to whom the Software is furnished to do so.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
10+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
11+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
12+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
13+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
14+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# AWS Starter React for GitHub Actions
2+
3+
This starter template contains a bootstrapped [Create React App](https://github.com/facebook/create-react-app) with a GitHub Workflow that deploys the app to the [AWS Amplify Console](https://aws.amazon.com/amplify/console/) using the [AWS CloudFormation Action for GitHub Actions](https://github.com/marketplace/actions/aws-cloudformation-deploy-cloudformation-stack-action-for-github-actions).
4+
5+
## Create a new repository from this template
6+
7+
Click the **Use this template** button above to create a new repository from this template.
8+
9+
> This repository uses the new [template feature](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-template-repository) of GitHub.
10+
11+
You need your own AWS account to deploy the app to the [AWS Amplify Console](https://aws.amazon.com/amplify/console/). Follow these [steps](https://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/) if you do not have an account.
12+
13+
The AWS CloudFormation stack is deployed via [AWS CloudFormation "Deploy CloudFormation Stack" Action for GitHub Actions](https://github.com/marketplace/actions/aws-cloudformation-deploy-cloudformation-stack-action-for-github-actions).
14+
15+
When you create a new repository from the template, the GitHub Workflow is not setup. To setup the workflow, you need to follow these steps.
16+
17+
1. Create a [new personal token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) with **full control of private repositories** store it as [encrypted secret](https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets) `AMPLIFY_TOKEN` in the new repository.
18+
2. Create a [new IAM user in your AWS account](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html) with **Programmatic Access** and store the access key ID as `AWS_ACCESS_KEY_ID` and secret access key as `AWS_SECRET_ACCESS_KEY` as secrets in your new repository.
19+
3. (Optional) Configure a [custom domain](https://docs.aws.amazon.com/amplify/latest/userguide/custom-domains.html) for your app by setting the `AMPLIFY_DOMAIN` secret.
20+
21+
If you are ready, either make a new change an push it, or *re-run* the [failed GitHub Workflow](https://help.github.com/en/actions/configuring-and-managing-workflows/managing-a-workflow-run).
22+
23+
Because the first time the app gets deployed to the AWS Amplify Console it is not fully configured, you need to trigger a first manual build. Go to the [AWS Amplify Console](https://console.aws.amazon.com/amplify) and select your app from the list of all apps.
24+
25+
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. In the frontend environments is should show no builds. Click on **Run Build** to initialize the app.
26+
27+
> The stack is deployed to `us-east-1` by default. Please change the region in the `.github/workflows/deploy.yaml` if you want to use a different one.
28+
29+
## Available Scripts
30+
31+
In the project directory, you can run:
32+
33+
### `yarn start`
34+
35+
Runs the app in the development mode.<br />
36+
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
37+
38+
The page will reload if you make edits.<br />
39+
You will also see any lint errors in the console.
40+
41+
### `yarn test`
42+
43+
Launches the test runner in the interactive watch mode.<br />
44+
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
45+
46+
### `yarn build`
47+
48+
Builds the app for production to the `build` folder.<br />
49+
It correctly bundles React in production mode and optimizes the build for the best performance.
50+
51+
The build is minified and the filenames include the hashes.<br />
52+
Your app is ready to be deployed!
53+
54+
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
55+
56+
### `yarn eject`
57+
58+
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
59+
60+
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
61+
62+
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
63+
64+
## Learn More
65+
66+
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
67+
68+
To learn React, check out the [React documentation](https://reactjs.org/).
69+
70+
## License
71+
72+
This library is licensed under the MIT-0 License. See the LICENSE file.

amplify.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: 1
2+
frontend:
3+
phases:
4+
test:
5+
commands:
6+
- yarn test
7+
preBuild:
8+
commands:
9+
- yarn install
10+
build:
11+
commands:
12+
- yarn run build
13+
artifacts:
14+
baseDirectory: build
15+
files:
16+
- '**/*'
17+
cache:
18+
paths:
19+
- node_modules/**/*

package.json

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "aws-starter-react-for-github-actions",
3+
"version": "0.1.0",
4+
"private": true,
5+
"dependencies": {
6+
"@testing-library/jest-dom": "^4.2.4",
7+
"@testing-library/react": "^9.3.2",
8+
"@testing-library/user-event": "^7.1.2",
9+
"@types/jest": "^24.0.0",
10+
"@types/node": "^12.0.0",
11+
"@types/react": "^16.9.0",
12+
"@types/react-dom": "^16.9.0",
13+
"react": "^16.13.1",
14+
"react-dom": "^16.13.1",
15+
"react-scripts": "3.4.1",
16+
"typescript": "~3.7.2"
17+
},
18+
"scripts": {
19+
"start": "react-scripts start",
20+
"build": "react-scripts build",
21+
"test": "react-scripts test",
22+
"eject": "react-scripts eject"
23+
},
24+
"eslintConfig": {
25+
"extends": "react-app"
26+
},
27+
"browserslist": {
28+
"production": [
29+
">0.2%",
30+
"not dead",
31+
"not op_mini all"
32+
],
33+
"development": [
34+
"last 1 chrome version",
35+
"last 1 firefox version",
36+
"last 1 safari version"
37+
]
38+
}
39+
}

public/favicon.ico

3.08 KB
Binary file not shown.

public/index.html

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<meta name="theme-color" content="#000000" />
8+
<meta
9+
name="description"
10+
content="Web site created using create-react-app"
11+
/>
12+
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
13+
<!--
14+
manifest.json provides metadata used when your web app is installed on a
15+
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
16+
-->
17+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
18+
<!--
19+
Notice the use of %PUBLIC_URL% in the tags above.
20+
It will be replaced with the URL of the `public` folder during the build.
21+
Only files inside the `public` folder can be referenced from the HTML.
22+
23+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
24+
work correctly both with client-side routing and a non-root public URL.
25+
Learn how to configure a non-root public URL by running `npm run build`.
26+
-->
27+
<title>React App</title>
28+
</head>
29+
<body>
30+
<noscript>You need to enable JavaScript to run this app.</noscript>
31+
<div id="root"></div>
32+
<!--
33+
This HTML file is a template.
34+
If you open it directly in the browser, you will see an empty page.
35+
36+
You can add webfonts, meta tags, or analytics to this file.
37+
The build step will place the bundled scripts into the <body> tag.
38+
39+
To begin the development, run `npm start` or `yarn start`.
40+
To create a production bundle, use `npm run build` or `yarn build`.
41+
-->
42+
</body>
43+
</html>

public/logo192.png

5.22 KB
Loading

public/logo512.png

9.44 KB
Loading

public/manifest.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"short_name": "React App",
3+
"name": "Create React App Sample",
4+
"icons": [
5+
{
6+
"src": "favicon.ico",
7+
"sizes": "64x64 32x32 24x24 16x16",
8+
"type": "image/x-icon"
9+
},
10+
{
11+
"src": "logo192.png",
12+
"type": "image/png",
13+
"sizes": "192x192"
14+
},
15+
{
16+
"src": "logo512.png",
17+
"type": "image/png",
18+
"sizes": "512x512"
19+
}
20+
],
21+
"start_url": ".",
22+
"display": "standalone",
23+
"theme_color": "#000000",
24+
"background_color": "#ffffff"
25+
}

public/robots.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# https://www.robotstxt.org/robotstxt.html
2+
User-agent: *
3+
Disallow:

0 commit comments

Comments
 (0)