https://github.com/mbround18/gh-reusable
A collection of reusable GitHub Actions and Workflows designed to streamline your CI/CD pipelines and automate common tasks. Easily integrate these actions and workflows into your projects to enhance efficiency and maintain consistency across your repositories.
https://github.com/mbround18/gh-reusable
actions cicd pipeline
Last synced: about 1 month ago
JSON representation
A collection of reusable GitHub Actions and Workflows designed to streamline your CI/CD pipelines and automate common tasks. Easily integrate these actions and workflows into your projects to enhance efficiency and maintain consistency across your repositories.
- Host: GitHub
- URL: https://github.com/mbround18/gh-reusable
- Owner: mbround18
- License: bsd-3-clause
- Created: 2024-01-29T01:28:30.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-08T16:03:33.000Z (about 1 month ago)
- Last Synced: 2025-04-08T16:35:03.798Z (about 1 month ago)
- Topics: actions, cicd, pipeline
- Language: JavaScript
- Homepage:
- Size: 122 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GH Reusable Actions and Workflows
Welcome to the **GH Reusable** repository! This repository contains a collection of reusable GitHub Actions and Workflows designed to streamline your CI/CD pipelines and automate common tasks in your projects.
## Overview
- **Reusable Actions**: Located in `actions/`. Each action is self-contained and comes with its own `README.md` detailing its purpose and usage.
- **Reusable Workflows**: Located in `.github/workflows/`. These are predefined workflows that can be included in your repositories.> **Note**: Any workflow prefixed with `test-` is intended for internal testing purposes and should **not** be used outside this repository.
## Getting Started
### Using Reusable Actions
To use any of the actions provided:
1. **Review the Action**: Navigate to `actions//README.md` to understand the action's functionality and required inputs.
2. **Reference the Action**: In your workflow file, use the `uses` keyword to include the action:```yaml
steps:
- name: Use Reusable Action
uses: mbround18/gh-reusable/actions/@v0.0.5
with:
# action inputs
```Replace `` with the name of the action and `v0.0.5` with the tag or commit SHA you wish to use.
### Using Reusable Workflows
To include a reusable workflow:
1. **Reference the Workflow**: In your workflow file, use the `uses` keyword under `jobs`:
```yaml
jobs:
my_job:
uses: mbround18/gh-reusable/.github/workflows/[email protected]
with:
# workflow inputs
```Replace `` with the workflow's filename (excluding any `test-` prefixed workflows) and `v0.0.5` with the desired tag or commit SHA.
Reusable Workflows
Name
Description
Workflow Name
Usage
Rust Build and Test
Click to see example.
jobs:
example:
uses: mbround18/gh-reusable/.github/workflows/[email protected]
with:
components: "clippy rustfmt" # Optional, Comma-separated list of Rust components to install (e.g., rustfmt, clippy).
target: "" # Optional, Comma-separated list of additional Rust compilation targets.
toolchain: "stable" # Optional, Rust toolchain to use (e.g., stable, nightly, beta).
Docker Release Workflow
Click to see example.
jobs:
example:
uses: mbround18/gh-reusable/.github/workflows/[email protected]
with:
image: "mbround18/example" # Required, Image Name
canary_label: "canary" # Optional,
compose: "false" # Optional, Want us to pull information from a docker-compose file?
context: "." # Optional, Build context
dockerfile: "./Dockerfile" # Optional, Dockerfile
dockerhub_username: "mbround18" # Optional, Who to log into dockerhub as.
ghcr: "false" # Optional, Release to GHCR?
ghcr_username: "mbround18" # Optional, Who to log into ghcr as.zs
semver_prefix: "" # Optional, Prefixer for semver, use this if you publish multiple artifacts like example-0.0.0
working-directory: "." # Optional, Working directory for the action
Reusable Actions
Name
Description
Usage
setup-rust
Sets up Rust toolchains, components, and additional CLI tools as needed.
Click here to see usage example.
steps:
- name: Use setup-rust action
uses: mbround18/gh-reusable/actions/setup-rust
with:
crates: "" # Required, Comma-separated list of CLI crates to install (e.g., trunk, wasm-bindgen).
components: "" # Optional, Comma-separated list of Rust components to install (e.g., rustfmt, clippy).
target: "" # Optional, Comma-separated list of additional Rust compilation targets.
toolchain: "stable" # Optional, Rust toolchain to use (e.g., stable, nightly, beta).
semver
Increments the base or last tag by the increment or version, supports custom prefixes like chart-name-1.2.3.
Click here to see usage example.
steps:
- name: Use semver action
uses: mbround18/gh-reusable/actions/semver
with:
base: "" # Optional, Base version to start from. If not provided, the last matching tag will be used.
increment: "patch" # Optional, Increment value (major, minor, patch). If not provided, will infer from PR or commit labels.
major-label: "major" # Optional, Label to identify a major increment (default: 'major').
minor-label: "minor" # Optional, Label to identify a minor increment (default: 'minor').
patch-label: "patch" # Optional, Label to identify a patch increment (default: 'patch').
prefix: "" # Optional, Optional prefix used to filter and build tag versions. Example: 'chart-name-' -> chart-name-1.2.3
token: "${{ github.token }}" # Optional, GitHub token for authentication with GraphQL API.
install-cli
Download and install a CLI from a GitHub release into GITHUB_ACTION_PATH/bin.
Click here to see usage example.
steps:
- name: Use install-cli action
uses: mbround18/gh-reusable/actions/install-cli
with:
asset: "" # Required, Asset file name pattern with %VERSION% placeholder (e.g., 'cli-%VERSION%-linux-amd64.tar.gz').
repository: "" # Required, GitHub repository in the format 'owner/repo' (e.g., 'trunk-rs/trunk').
github-token: "${{ github.token }}" # Optional, GitHub token for API requests.
override-name: "" # Optional, Optional. Rename the CLI binary to this name.
version: "latest" # Optional, Version of the release to install (default is latest).
graphql
Executes a GraphQL query or mutation using provided inputs
Click here to see usage example.
steps:
- name: Use graphql action
uses: mbround18/gh-reusable/actions/graphql
with:
query: "" # Required, Inline GraphQL query/mutation or a path to a file containing the query
token: "" # Required, GitHub token for authenticating the API call
args: "" # Optional, Comma or newline separated key=value pairs for query variables
url: "https://api.github.com/graphql" # Optional, GraphQL endpoint URL; defaults to GitHub GraphQL API
github-catalog
Generates a GitHub catalog of reusable workflows and actions, and inserts HTML tables into README.md.
Click here to see usage example.
steps:
- name: Use github-catalog action
uses: mbround18/gh-reusable/actions/github-catalog
with:
token: "${{ github.token }}" # Required, GitHub token with write access to the repository
ensure-repository
Ensures the repository that the action or workflow is running on is a known element.
Click here to see usage example.
steps:
- name: Use ensure-repository action
uses: mbround18/gh-reusable/actions/ensure-repository
with:
repository: "mbround18/gh-reusable" # Required, Specific repository (eg: mbround18/gh-reusable)
docker-facts
Extracts dockerfile, context, and build args from docker-compose.yml
Click here to see usage example.
steps:
- name: Use docker-facts action
uses: mbround18/gh-reusable/actions/docker-facts
with:
image: "" # Required, Base image name (e.g., mbround18/steamcmd)
canary_label: "" # Optional, Label to trigger canary pushes
context: "" # Optional, Default context path if not found in compose
dockerfile: "" # Optional, Default Dockerfile path if not found in compose
docker-build
Build Docker images with build arguments, secrets, and multi-platform support
Click here to see usage example.
steps:
- name: Use docker-build action
uses: mbround18/gh-reusable/actions/docker-build
with:
context: "." # Required, Build context directory
dockerfile: "./Dockerfile" # Required, Path to the Dockerfile relative to the context
image: "mbround18/test" # Required, Name of the image to be built
version: "latest" # Required, Image tag version
canary_label: "" # Optional, Label to trigger canary pushes
platforms: "linux/amd64" # Optional, Comma separated list of target platforms (e.g., linux/amd64,linux/arm64)
push: "false" # Optional, Whether to push the image
registries: "" # Optional, Comma separated list of registries to re-tag the image with
## Contributing
We welcome contributions! To contribute:
1. **Fork the Repository**: Click the "Fork" button at the top-right corner of this page.
2. **Create a Branch**: Use a descriptive name for your branch (e.g., `feature/new-action` or `fix/issue-123`).
3. **Make Changes**: Implement your feature or fix and update/add documentation as needed.
4. **Submit a Pull Request**: Open a pull request with a clear description of your changes.## License
This project is licensed under the [BSD 3-Clause License](LICENSE).