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.
| 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). |
| 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. |
- Create a workflow in your project (e.g.
.github/workflows/ci.yaml). - Use the action or workflow you need.
- Prefer immutable refs for callers.
Recommended:
uses: krudi/reusable-actions/.github/workflows/release-and-publish.yaml@v1Temporary during active development:
uses: krudi/reusable-actions/.github/workflows/release-and-publish.yaml@mainUse @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:
ci-commandgithub-checkoutnode-setupnode-installnode-buildnode-next-cachephp-setupphp-composer-cachephp-install-run
Use this for special cases where you want npm publishing without the shared release step.
Important inputs:
workspacecheck_commandbuild_commandnpm_accessnpm_provenancecheckout_ref
Use this for special cases where you want VS Code publishing without the shared release step.
Important inputs:
check_commandpackage_commandpublish_commandvsce_globcheckout_refrelease_tag
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:
versionpublish_targetcreate_latestworkspacetag_prefixpackage_json_pathpackage_lock_pathcheck_commandbuild_commandpackage_command
Use this for release.published or manual deploy wrappers in TYPO3 repos.
Important inputs:
php_versioncomposer_install_commandnode_install_commandnode_build_commanddep_command
Current release contracts in caller repos:
- single-package repos:
vX.Y.Z shared-configs:@krudi/<package>@X.Y.Zshared-styles:@krudi/<package>@X.Y.Z- TYPO3 repos:
package.jsonis the release version source of truth;composer.jsonis not versioned
Examples:
@krudi/eslint-config@0.1.9@krudi/styles@0.1.3v0.6.0
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 }}