Skip to content

krudi/outdated-reusable-actions

Repository files navigation

reusable-workflows

Reusable GitHub Actions building blocks for my projects. This repo now contains both composite actions and reusable workflows so release, publish, and deploy logic can stay consistent across repositories.

Warning

These are built for my personal projects and may not fit every setup without adjustment.

Composite actions

Action Path What it does
GitHub Checkout .github/actions/github-checkout Checkout repository at current ref.
CI Command .github/actions/ci-command Run a provided CI command (matrix-friendly).
Node Setup .github/actions/node-setup Set up Node with optional cache and version-file support.
Node Install .github/actions/node-install Install Node dependencies (no checkout/setup).
Node Build .github/actions/node-build Build Node projects (no checkout/setup).
Node Next Cache .github/actions/node-next-cache Cache npm and .next/cache.
npm Publish .github/actions/npm-publish Publish npm packages (workspace or root) with provenance.
PHP Setup .github/actions/php-setup Set up PHP with extensions/tools.
PHP Composer Cache .github/actions/php-composer-cache Cache Composer deps and vendor.
PHP Install Run .github/actions/php-install-run Install PHP dependencies (no checkout/setup).

Reusable workflows

Workflow Path What it does
Release And Publish .github/workflows/release-and-publish Create the release, then optionally publish npm or VS Code in the same run.
Publish NPM Package .github/workflows/publish-npm Install, optionally check/build, and publish a package to npm.
Publish VS Code .github/workflows/publish-vscode Install, check, package, upload VSIX, and publish extension.
Deploy TYPO3 .github/workflows/deploy-typo3 Run the shared TYPO3 deploy pipeline.

Quick start

  1. Create a workflow in your project (e.g. .github/workflows/ci.yaml).
  2. Use the action or workflow you need.
  3. Prefer immutable refs for callers.

Recommended:

uses: krudi/reusable-actions/.github/workflows/release-and-publish.yaml@v1

Temporary during active development:

uses: krudi/reusable-actions/.github/workflows/release-and-publish.yaml@main

Use @main only while iterating. Once the reusable interface is stable, move callers to a tagged ref such as @v1.

Usage examples (with inputs) live alongside each action:

Workflow contracts

publish-npm

Use this for special cases where you want npm publishing without the shared release step.

Important inputs:

  • workspace
  • check_command
  • build_command
  • npm_access
  • npm_provenance
  • checkout_ref

publish-vscode

Use this for special cases where you want VS Code publishing without the shared release step.

Important inputs:

  • check_command
  • package_command
  • publish_command
  • vsce_glob
  • checkout_ref
  • release_tag

release-and-publish

Use this when you want one manual workflow that accepts a version input, creates the tag and GitHub release with generated notes, and then immediately publishes the selected target.

Important inputs:

  • version
  • publish_target
  • create_latest
  • workspace
  • tag_prefix
  • package_json_path
  • package_lock_path
  • check_command
  • build_command
  • package_command

deploy-typo3

Use this for release.published or manual deploy wrappers in TYPO3 repos.

Important inputs:

  • php_version
  • composer_install_command
  • node_install_command
  • node_build_command
  • dep_command

Release tag conventions

Current release contracts in caller repos:

  • single-package repos: vX.Y.Z
  • shared-configs: @krudi/<package>@X.Y.Z
  • shared-styles: @krudi/<package>@X.Y.Z
  • TYPO3 repos: package.json is the release version source of truth; composer.json is not versioned

Examples:

  • @krudi/eslint-config@0.1.9
  • @krudi/styles@0.1.3
  • v0.6.0

Real-world workflow examples

Node lint matrix

name: Lint

on:
    pull_request:
        types: [opened, synchronize, reopened]

jobs:
    lint:
        runs-on: ubuntu-latest
        strategy:
            fail-fast: false
            matrix:
                lint-commands:
                    - 'npm run lint:eslint'
                    - 'npm run lint:stylelint'

        steps:
            - uses: krudi/reusable-actions/.github/actions/github-checkout@main

            - uses: krudi/reusable-actions/.github/actions/node-setup@main
              with:
                  cache: npm
                  node_version_file: .nvmrc

            - uses: krudi/reusable-actions/.github/actions/node-install@main

            - uses: krudi/reusable-actions/.github/actions/ci-command@main
              with:
                  command: ${{ matrix.lint-commands }}

Monorepo package release + publish

name: Release eslint-config

on:
    workflow_dispatch:
        inputs:
            version:
                required: true
                type: string

jobs:
    release:
        uses: krudi/reusable-actions/.github/workflows/release-and-publish.yaml@v1
        with:
            version: ${{ inputs.version }}
            publish_target: npm
            workspace: '@krudi/eslint-config'
            package_json_path: packages/eslint-config/package.json
            package_lock_path: package-lock.json
            tag_prefix: '@krudi/eslint-config@'
            commit_message: 'chore(release): bump @krudi/eslint-config from {old} to {new}'
        secrets:
            NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

About

Composite actions for common Node.js CI steps. Keep workflows lean by reusing these blocks instead of duplicating setup logic across repos.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors