This project was bootstrapped with Create React App.
It will illustrate how we can test, build and package a web app before publishing into a registry with automation via Github actions.
For the second part of this demo, please go to Bluesky GitOps
- A developer can trigger a release by updating a Git reponsitory which contains the application code
- Github Actions will test , build and package the web app into a container
- Upon packaging , Github actions will publish the container to a container registry
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
Note: this is a one-way operation. Once you eject
, you can’t go back!
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.
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.
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.
docker build -t reponame/imagename:tag .
docker run -d --name containername -p 3000:3000 reponame/imagename:tag
- Generating helm template
helm create <<chart-name>>
- Modification on the default values
Update container port to 3000, since our code are running on port 3000
ports:
- name: http
containerPort: 3000
protocol: TCP
- Install via helm
Install helm chart for bluesky react.
helm install <<release-name>> ./helm --kube-context <<kube context>>
- Port forward for your own testing
kubectl port-forward service/release-name 3011:3000
Try testing the page response
curl http://localhost:3011
- Clean-up helm chart
helm uninstall <<release-name
More about Github actions Github Actions with Container Push
Dockerizing an react app Deploying React App to DigitalOcean
You can learn more in the Create React App documentation.
To learn React, check out the React documentation.