version: 0.2
phases:
install:
runtime-versions:
nodejs: latest
commands:
# install yarn
- npm install yarn
# install dependencies
- yarn
# so that build commands work
- yarn add eslint-config-react-app
build:
commands:
# run build script
- yarn build
artifacts:
# include all files required to run application
# we include only the static build files
files:
- '**/*'
base-directory: 'build'
aws codecommit create-repository --repository-name fcj-book-store-frontend
You will see output similar to the following
{
"repositoryMetadata": {
"accountId": "111111111111",
"repositoryId": "b782c34e-77dc-4627-8aea-ae8bd5ea79a9",
"repositoryName": "fcj-book-store-frontend",
"lastModifiedDate": "2022-09-19T14:49:51.325000+07:00",
"creationDate": "2022-09-19T14:49:51.325000+07:00",
"cloneUrlHttp": "https://git-codecommit.ap-southeast-1.amazonaws.com/v1/repos/fcj-book-store-frontend",
"cloneUrlSsh": "ssh://git-codecommit.ap-southeast-1.amazonaws.com/v1/repos/fcj-book-store-frontend",
"Arn": "arn:aws:codecommit:ap-southeast-1:111111111111:fcj-book-store-frontend"
}
}
git init -b main
git add .
git commit -m "Initial commit"
git remote add origin codecommit://fcj-book-store-frontend
If origin already exists or url is wrong, can remove it by running: git remote rm origin
git push -u origin main