GitHub Actions + React JS+ Azure Web App
So, I figured out how to deploy, static web app with GitHub Actions with Azure Web App. I thought, how hard can react js be? Well, it’s very hard.
as usual, the full code, is here.
GitHub - Jay-study-nildana/GitHubActionsReactJS: a github actions azure web app example for React…
reacj hello world for 2023 note: this is borrowed from my react js project, available, here…
So, let’s go.
make sure you have a react project ready. You can find several, react projects that are alive and running, here.
FrontEndForStudents/ReactJSForStudents at main · Jay-study-nildana/FrontEndForStudents
some React JS related code for my students. https://codesandbox.io/s/react-template-bootstrap-cx3k9n…
Also, you may want to read the more simpler, GitHub Actions activity with a static web app. Just to get you warmed up.
GitHub Actions + Vanilla JS Bootstrap + Azure Web App
Right then, this month, I am teaching deployment to my ongoing tutoring batches.
Okay, so, with all that preparation, let’s begin.
First up, get your YAML file ready. And, of course, an azure web app should be ready too.
the YAML, would look something like this.
So, that is mostly self explanatory. Two things, I wish to emphasize.
this step will cut down about 40 minutes from your ‘build’ step.
run: zip release.zip ./* -r
and this step, will ensure that your react web app, actually runs.
and, here are some general notes to remember.
- even if your app runs just fine, locally, you will get a lot of problems when you deploy.
- make sure, the env values are updated immediately to match your azure web app.
- I had to use “build”: “CI=false && react-scripts build”. usually, the “CI=false” is not neccessary, if your react code is perfect and has zero warnings. mine has a lot of warnings, and I did not want to fix it.
- unit tests. I did not want any unit tests to run. so, I removed the ‘test’ section from package.json.
- now, even after all this, you will not have build errors. but, you will still get plenty of deployment errors.
- timeouts can happen.
- the target web app might not be powerful enough, storage, RAM, network bandwidth on azure, to perform the deployment. so, you may have to use a higher level, more expensive web app.
- the deployment step can take anywhere from 10 to 20 minutes.
And, that’s, that. happy deploying.
I work as a full-time freelance coding tutor. Hire me at UpWork or Fiverr or Stack Overflow or GitHub. see my personal website. see my photography art hobby at Behance and Unsplash and ArtStation. Also, podcast about life. podcast about movies. and Twitch. and YouTube Channel. If you are a student, join my discord server.