Configure Github Actions for bulid
- Let start by setting up
Node.jsworkflow. -
Go to
Actionstab in your project and findNode.jsworkflow.

(it may be hidden under
More continuous integration workflows...)

and pressSet up this workflowbutton. Rename
node.js.ymltobuild.yml. Commitbuild.ymlwithStart commitbutton. AddCreate .github/workflows/build.ymlcommit message.

On commit pre-commit.ci may fail because of prettier formatting.
git pullpre-commit run --all-filesgit add -ugit commit -m 'fix: prettier formating'
Update .github/workflows/build.yml
-
We do not have tests yet and
buildis present inpackage.json
- run: npm ci - - run: npm run build --if-present - - run: npm test + - run: npm run build git add -ugit commit -m 'do not run npm test for build workflow'
Add badge
-
Add
to README.md. From docsYou reference the workflow by the name of your workflow file.

git add -ugit commit -m 'add build workflow badge'
Links
- https://docs.github.com/en/actions
- https://docs.github.com/en/actions/guides/setting-up-continuous-integration-using-workflow-templates
- https://github.com/actions/setup-node
- https://github.com/actions/starter-workflows/blob/main/ci/node.js.yml
Top comments (0)