It is well known in any React project that after any modification in its source code (src/**.js, package.json mainly), it is necessary to deploy to production (executing npm run deploy) if we want to see said changes at https://ebookfoundation.github.io/free-programming-books-search
Well, this pipeline/workflow automates this process as part of a continuous integration cycle (lint-build-test-deploy) by:
Linting the code with ESLint. Warnings are noted near the line of code where they occur (see the Files tab of each PR).
Build. Makes the artefact deployed in production. Also ensures that all problems in a CI environment are resolved.
Test: Runs the unit/e2e test that ensures all is rendered as expected
Deploy. No more npm run deploy if push to main branch. Now it's automated.
The deploy to gh-pages only happens when merged/push to main :wink:. In the other hand, a git dry-run execution is performed to test the job on pull-request events.
~The lint-test phases are TODOs because the project requires a refactor to format it according to Prettier/ESLint or current testscases don't pass!!~
~The test phases/jobs are faked. If enabled, it didn't work per-sé. Ssee failed runs:~
~Unfortunatelly I don't know how to fix the integration of create-react-app + jest + babel to work with ES modules. So are conditionally disabled and annotated as TODOs~
What does this PR do?
Add feature(s) | Fix
Description
It is well known in any React project that after any modification in its source code (
src/**.js
,package.json
mainly), it is necessary to deploy to production (executingnpm run deploy
) if we want to see said changes at https://ebookfoundation.github.io/free-programming-books-searchWell, this pipeline/workflow automates this process as part of a continuous integration cycle (lint-build-test-deploy) by:
npm run deploy
if push to main branch. Now it's automated.Due to build the artifact in a CI environment I've needed to fix some lint warnings in several
*.js
files. ⚠️ Pipeline fails if not resolved. See: https://github.com/davorpa/free-programming-books-search/actions/runs/3057895260/jobs/4933516460#step:5:14Context
Resolves #35
~The lint-test phases are TODOs because the project requires a refactor to format it according to Prettier/ESLint or current testscases don't pass!!~ ~The test phases/jobs are faked. If enabled, it didn't work per-sé. Ssee failed runs:~
~Unfortunatelly I don't know how to fix the integration of create-react-app + jest + babel to work with ES modules. So are conditionally disabled and annotated as TODOs~