DEV Community

Cover image for Setting up a CI/CD workflow on GitHub Actions for a React App (with GitHub Pages and Codecov)

Setting up a CI/CD workflow on GitHub Actions for a React App (with GitHub Pages and Codecov)

Dyarlen Iber on June 19, 2020

In this tutorial, I'm going to show you how to create a simple workflow that I use on my personal projects with React. This workflow created on Gi...
Collapse
 
nicksettler profile image
NickSettler

Have you thought about adding cache for dependencies? For example, caching node_modules folder

Collapse
 
dyarleniber profile image
Dyarlen Iber

It's a great suggestion, thank you. I'll read more about caching on GH Actions and update this post.

Collapse
 
nicksettler profile image
NickSettler

I have used cache in GitHub Actions in this project
Check it out if you want
github.com/NickSettler/bot.settler...

Thread Thread
 
niteshkumar2000 profile image
Niteshkumar

Hello, thanks for referencing this, I was exactly searching for this.
I cherry-picked and gave authorship to you here :)
github.com/niteshkumar2000/Real-Ti...

Collapse
 
eomm profile image
Manuel Spigolon

Why it is necessary to create a new secret token when the GITHUB_TOKEN seems to have all the mandatory scopes?

I have tried and it won't work, but I would like to know if someone has an answer for that

Collapse
 
boly38 profile image
Brice

Hi, a little question,
you say

The predeploy script will run automatically before deploy is run

why does you final yml contains a build step before a deploy step if deploy automatically run predeploy (build) ?

Collapse
 
tlylt profile image
Liu Yongliang

Thanks!

Just a note for those using yarn instead of npm: you can replace the use of the word npm in the examples above with yarn and it should still work fine.

Collapse
 
johanputra profile image
johanputra

where does it set the .env? I have a problem if the .env doesn't read according to what I input.

Collapse
 
justtrey profile image
just-trey

I just read this after I wrote something similar just today. You are at my Part 2 which I still have to write. This is a great topic!

Collapse
 
kenbigler profile image
Ken Bigler • Edited

Awesome article! 1 note to anyone wondering, you need to rebase any currently open PRs for the checks tab to start working.

Collapse
 
theapplefreak profile image
TheAppleFreak

If I might ask, why is there a predeploy build script in package.json when there's a dedicated build task in the workflow file?