In this tutorial, I will show you how to make the easy workflow I use for my React projects.
The workflow created in GitHub Actions will be responsible for pulling the latest source code, generating a test report spread if test are configured and uploading it to Codecov, building and posting the project on GitHub pages. All of these activities will be done through a push event into your branch.
First of all, in your last React App GitHub, navigate to the last main page, click on Actions.
After that, you will see CI template suggestions that are best suited for your project. You can use workflow templates as the starting point for building your custom workflow. In this case, click Set this functionality, under the Node.js template name.
Finally, you will see the default YAML file as follows:
First, go to Codecov’s website and create an account, you can use a GitHub account to sign-up.
Next, access your account on the website, click Cache, in the background, click Enter new storage location and select the last location you want to use. (we will set the secret in abit)
Posting on GitHub pages
Insert gh pages and adddeploy to the text in package.json. Get Started: $ npm install - save gh pages Include the following texts in your package. "pre-use": "npm run build", "download": "gh-pages -d build",
We will now create a new access token, to send our application to workflow.
Go to the location for personal access tokens in the developer settings of your GitHub profile and click Start new token.
Copy the generated token.
In GitHub, navigate to the last main page, under your last name, click Settings. In the sidebar on the left, click Secrets. And finally, Click Add New Secret.
Type your password in the input box, such as ACTIONS_DEPLOY_ACCESS_TOKEN.
Enter your privacy value (which should be a newly created personal access token).
Click Add Secret.
Your last step in your career journey should be as follows: