{"id":13626435,"url":"https://github.com/sbstjn/cra-pipeline","last_synced_at":"2025-04-21T22:33:25.896Z","repository":{"id":137670775,"uuid":"235557317","full_name":"sbstjn/cra-pipeline","owner":"sbstjn","description":"Use AWS CDK with CodePipeline to deploy a TypeScript Create-React-App.","archived":false,"fork":false,"pushed_at":"2020-06-07T18:19:24.000Z","size":649,"stargazers_count":41,"open_issues_count":6,"forks_count":15,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-01T16:24:16.832Z","etag":null,"topics":["aws-cdk","aws-codepipeline","cra","cra-pipeline","deployment","pipeline","react","serverless"],"latest_commit_sha":null,"homepage":"https://sbstjn.com/deploy-react-cra-with-cdk-codepipeline-and-codebuild.html","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sbstjn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-22T11:16:05.000Z","updated_at":"2024-08-13T03:40:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"e8c896cc-156e-458b-973a-709c15191bd1","html_url":"https://github.com/sbstjn/cra-pipeline","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbstjn%2Fcra-pipeline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbstjn%2Fcra-pipeline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbstjn%2Fcra-pipeline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbstjn%2Fcra-pipeline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sbstjn","download_url":"https://codeload.github.com/sbstjn/cra-pipeline/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250145280,"owners_count":21382388,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-cdk","aws-codepipeline","cra","cra-pipeline","deployment","pipeline","react","serverless"],"created_at":"2024-08-01T21:02:18.524Z","updated_at":"2025-04-21T22:33:20.885Z","avatar_url":"https://github.com/sbstjn.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# CRA Pipeline\n\n[![MIT License](https://badgen.now.sh/badge/License/MIT/blue)](https://github.com/sbstjn/cra-pipeline/blob/master/LICENSE.md)\n[![Read Tutorial](https://badgen.now.sh/badge/Read/Tutorial/orange)](https://sbstjn.com/deploy-react-cra-with-cdk-codepipeline-and-codebuild.html)\n\n\u003e Example [AWS CDK](https://docs.aws.amazon.com/cdk/latest/guide/home.html) project to deploy a TypeScript SPA created with [create-react-app](https://github.com/facebook/create-react-app) using [AWS CodePipeline](https://aws.amazon.com/codepipeline/) and [AWS CodeBuild](https://aws.amazon.com/codebuild/). Of course, [styled-components](https://styled-components.com/) is included as well …\n\u003e\n\u003e [http://pipeline-files8e6940b8-tyzn4y41xz9l.s3-website-us-east-1.amazonaws.com](http://pipeline-files8e6940b8-tyzn4y41xz9l.s3-website-us-east-1.amazonaws.com/)\n\n## Architecture\n\n### Components\n\n- [create-react-app](https://github.com/facebook/create-react-app) using TypeScript\n- React SPA with [styled-components](https://styled-components.com/)\n- [AWS CDK](https://docs.aws.amazon.com/cdk/latest/guide/home.html) for infrastructure\n- [AWS CodePipeline](https://aws.amazon.com/codepipeline/) with GitHub hook\n- Amazon S3 bucket for website hosting\n\n## Usage\n\n```bash\n$ \u003e yarn cdk deploy Pipeline\n\nPipeline: deploying...\nPipeline: creating CloudFormation changeset...\n\n✅  Pipeline\n\nOutputs:\nPipeline.WebsiteURL = http://pipeline-files8e6940b8-3p9gac9qjzax.s3-website-us-east-1.amazonaws.com\n```\n\n### Configuration\n\n```js\n// Edit ./config.ts\n\nexport const config = {\n  github: {\n    owner: 'sbstjn',\n    repository: 'cra-pipeline',\n  },\n  env: { region: 'us-east-1' },\n}\n```\n\n## Preliminaries\n\n### Install AWS CDK\n\n```bash\n# Using NPM\n$ \u003e npm install -g aws-cdk\n\n# Using Yarn\n$ \u003e yarn global add aws-cdk\n```\n\n### Configure AWS CLI\n\nGenerate an `Access Key` and `Secret Access Key` for your AWS account.\n\n```bash\n$ \u003e export AWS_ACCESS_KEY_ID=\"…\"\n$ \u003e export AWS_SECRET_ACCESS_KEY=\"…\"\n$ \u003e export AWS_SESSION_TOKEN=\"…\"\n```\n\n### Bootstrap AWS CDK\n\n```bash\n$ \u003e yarn cdk bootstrap --region us-east-1\n\n⏳  Bootstrapping environment aws://123456789001/us-east-1...\n\n0/2 | 5:06:49 PM | CREATE_IN_PROGRESS   | AWS::S3::Bucket | StagingBucket\n0/2 | 5:06:50 PM | CREATE_IN_PROGRESS   | AWS::S3::Bucket | StagingBucket Resource creation Initiated\n1/2 | 5:07:11 PM | CREATE_COMPLETE      | AWS::S3::Bucket | StagingBucket\n\n✅  Environment aws://123456789001/us-east-1 bootstrapped.\n```\n\n### Configure GitHub Token\n\nCreate a [personal access token in GitHub](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) and store it in [AWS SecretsManager](https://aws.amazon.com/secrets-manager/). The token needs permissions to read your (private) repositories and configure webhooks.\n\n```bash\n$ \u003e aws secretsmanager create-secret \\\n    --name GitHubToken \\\n    --secret-string abcdefg1234abcdefg56789abcdefg \\\n    --region us-east-1\n\n{\n  \"ARN\": \"arn:aws:secretsmanager:us-east-1:123456789001:secret:GitHubToken-uNBxTr\",\n  \"Name\": \"GitHubToken\",\n  \"VersionId\": \"4acda3d1-877f-4032-b38e-17bc50239883\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbstjn%2Fcra-pipeline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsbstjn%2Fcra-pipeline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbstjn%2Fcra-pipeline/lists"}