Code Monkey home page Code Monkey logo

reusable-workflows's Introduction

Contributors Forks Stargazers Issues


reusable-workflows

Reusable workflows for all my github stuff

· Report Bug · Request Feature ·

About The Project

Reusable workflows for all my github stuff. See reusing-workflows.

Disclaimer

Most workflows are fitted to my taste of development. This project is still open source since i believe oversharing is better. So if you are going to use this be aware that those workflows are meant for my own repositories and will grow and adapt with the needs of them.

Workflows

Publish a NPM package to the NPM registry.

Inputs

Name Description Type Default Required
dist_tag NPM dist tag to publish to. string latest false
node_version Node version to build on. string 18 false
package_manager Package manager to use. Can be 'npm' or 'bun'. string npm false

Secrets

Name Description Required
NPM_TOKEN NPM token with right access for publishing. true

Environment deployment

It deploys to a environment with the same name as the dist_tag.

Publish a NPM package to the GitHub registry.

Inputs

Name Description Type Default Required
dist_tag NPM dist tag to publish to. string `` true
node_version Node version to build on. string 18 false
package_manager Package manager to use. Can be 'npm' or 'bun'. string npm false

Secrets

Name Description Required
GITHUB_TOKEN GitHub token with right access for publishing. true

Remove a dist-tag from the GitHub registry.

Inputs

Name Description Type Default Required
dist_tag NPM dist tag to remove. string true

Secrets

Name Description Required
GITHUB_TOKEN GitHub token with right access for removing. true

Deploys a service to a specified environment.

Inputs

Name Description Type Default Required
environment_name Name of environment. string none true

Secrets

Name Description Required
SSH_HOST SSH server to log in via SSH. true
SSH_USERNAME SSH username to log in via SSH. true
SSH_KEY SSH secret key to log in via SSH. true
ENVIRONMENT Environment file string to be used during deployment. true

Environment deployment

It deploys to a environment with the same name as the environment_name.

Testing for node app using npm as package manager, libraries and components.

Inputs

Name Description Type Default Required
node_versions Node versions matrix to test on. string ['16.x', '17.x', '18.x'] false
package_manager Package manager to use. Can be 'npm' or 'bun'. string npm false
format_command Format command to run. To disable set to ''. string npm run format false
lint_command Lint command to run. To disable set to ''. string npm run lint false
build_command Build command to run. string npm run build false
test_command Test command to run. To disable set to ''. string npm run test false
run_jest_coverage Run and report the coverage with jest. Uses test_command as base. boolean true false
skip_coverage_report Skip coverage reporting for resources that can not accept comments. boolean false false

Permissions

Name value Description
pull-requests write Only needed if job is used in a job with the pull_request trigger.
contents write Only needed if job is used in a job with the push trigger.

Testing for node app using bun as package manager, libraries and components.

Inputs

Name Description Type Default Required
node_versions Node versions matrix to test on. string ['16.x', '17.x', '18.x'] false
format_command Format command to run. To disable set to ''. string bun run format false
lint_command Lint command to run. To disable set to ''. string bun run lint false
build_command Build command to run. string bun run build false
test_command Test command to run. To disable set to ''. string bun run test false
run_jest_coverage Run and report the coverage with jest. Uses test_command as base. boolean true false
skip_coverage_report Skip coverage reporting for resources that can not accept comments. boolean false false

Permissions

Name value Description
pull-requests write Only needed if job is used in a job with the pull_request trigger.
contents write Only needed if job is used in a job with the push trigger.

Checks out the commit, set up the node env and setup the package manager with caching.

Inputs

Name Description Type Default Required
node_versions Node versions matrix to test on. string ['16.x', '17.x', '18.x'] false
package_manager Package manager to use. Can be 'npm' or 'bun'. string npm false
dependencies_type Dependencies type to install. Can be 'prod' or 'dev' string prod false
registry_url Registry url to use. string https://registry.npmjs.org false

Directory structure and file naming

Reusable workflows are YAML-formatted files, very similar to any other workflow file. As with other workflow files, you locate reusable workflows in the .github/workflows directory of a repository. Subdirectories of the workflows directory are not supported.

From Creating a reusable workflow

So until we have something nicer here, I'll use file naming to create some sort of organization.

  • internal-* will be used for workflows for this repository not meant for reusing
  • for the others i will just convert my wanted subdirectories to filenames like: qa/eslint.yml to qa-eslint.yml

reusable-workflows's People

Contributors

beuluis avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.