Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE-36] Create CI/CD pipeline with build-deploy steps #36

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

davorpa
Copy link
Member

@davorpa davorpa commented Sep 15, 2022

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 (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.

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:14

Context

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

@davorpa davorpa marked this pull request as draft September 15, 2022 09:55
/home/runner/work/free-programming-books-search/free-programming-books-search/node_modules/react-markdown/index.js:6
    export {uriTransformer} from './lib/uri-transformer.js'
    ^^^^^^

    SyntaxError: Unexpected token 'export'

      2 | import axios from "axios";
      3 |
    > 4 | import ReactMarkdown from "react-markdown";
        | ^
      5 | import rehypeSlug from "rehype-slug";
      6 | import rehypeRaw from "rehype-raw";
      7 |
@davorpa davorpa marked this pull request as ready for review September 15, 2022 14:08
@davorpa davorpa marked this pull request as draft September 16, 2022 08:17
using "jest.transformIgnorePatterns"
it already holds the inital code 馃槦
@davorpa davorpa marked this pull request as ready for review September 16, 2022 13:15
@davorpa
Copy link
Member Author

davorpa commented Sep 16, 2022

Testing jobs has been fixed in bae6a01

PR ready to review 馃殌

- 'screen' is defined but never used

Fix over 5f24ef9
@davorpa davorpa changed the title Create CI/CD pipeline with build-deploy steps [FEATURE-36] Create CI/CD pipeline with build-deploy steps Sep 19, 2022
if: ${{ false }}
run: npm run test:e2e

deploy:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can use GitHub deploy pages action here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automate the github-pages deploy on alter main branch
2 participants