https://github.com/peaceiris/workflows
GitHub Actions Composite/Reusable Workflows
https://github.com/peaceiris/workflows
actions github-actions
Last synced: about 1 month ago
JSON representation
GitHub Actions Composite/Reusable Workflows
- Host: GitHub
- URL: https://github.com/peaceiris/workflows
- Owner: peaceiris
- License: mit
- Created: 2020-09-27T12:44:32.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-04-10T20:17:58.000Z (about 2 years ago)
- Last Synced: 2024-05-02T06:14:27.640Z (about 2 years ago)
- Topics: actions, github-actions
- Homepage:
- Size: 1.18 MB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Composite Run Steps GitHub Actions
A collection of composite run steps GitHub Actions.
> [Creating a composite action - GitHub Docs](https://docs.github.com/en/actions/creating-actions/creating-a-composite-action)
## Setup Docker Project
This composite action includes the following actions:
- Install docker compose v2
- Install docker buildx
Definition: [setup-docker/action.yml](https://github.com/peaceiris/workflows/blob/main/setup-docker/action.yml)
### Install the Latest Version
```yaml
name: CI
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: peaceiris/workflows/setup-docker@v0.21.2
- run: docker compose version
- run: docker buildx version
```
### Install a Specific Version
```yaml
name: CI
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: peaceiris/workflows/setup-docker@v0.21.2
with:
compose-version: '2.4.1'
buildx-version: '0.8.2'
- run: docker compose version
- run: docker buildx version
```
## Setup Go Project
This composite action includes the following actions:
- `actions/setup-go`
- `peaceiris/workflows/setup-mage`
- `peaceiris/workflows/setup-goreleaser`
- `actions/cache`
Definition: [setup-go/action.yml](https://github.com/peaceiris/workflows/blob/main/setup-go/action.yml)
```yaml
name: CI
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: peaceiris/workflows/setup-go@v0.21.2
with:
go-version: '1.18'
- run: go version
- run: mage -h
- run: goreleaser -h
```
## Setup Node.js Project
This composite action includes the following actions:
- `actions/setup-node`
- `actions/cache`
Definition: [setup-node/action.yml](https://github.com/peaceiris/workflows/blob/main/setup-node/action.yml)
```yaml
name: CI
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: peaceiris/workflows/setup-node@v0.21.2
with:
node-version: '16.14.2'
# node-version-file: '.nvmrc'
- run: node -v
- run: npm -v
```
## Setup Python Project
This composite action includes the following actions:
- `actions/setup-python`
- `actions/cache`
Definition: [setup-python/action.yml](https://github.com/peaceiris/workflows/blob/main/setup-python/action.yml)
```yaml
name: CI
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: peaceiris/workflows/setup-python@v0.21.2
with:
python-version: '3.10'
- run: python3 -V
- run: python3 -m pip -V
- run: python3 -m pipenv --version
```
## Setup Rust Project
This composite action includes the following actions:
- `actions/cache`
Definition: [setup-rust/action.yml](https://github.com/peaceiris/workflows/blob/main/setup-rust/action.yml)
```yaml
name: CI
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: peaceiris/workflows/setup-rust@v0.21.2
```
## Setup [goreleaser/goreleaser]
Install `goreleaser` to a GitHub Actions Ubuntu virtual environment.
Definition: [setup-goreleaser/action.yml](https://github.com/peaceiris/workflows/blob/main/setup-goreleaser/action.yml)
[goreleaser/goreleaser]: https://github.com/goreleaser/goreleaser/
### Install the Latest Version
Here is an example GitHub Actions workflow to install the latest `goreleaser` and run it.
```yaml
name: CI
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: peaceiris/workflows/setup-goreleaser@v0.21.2
- run: goreleaser -h
- run: goreleaser check
```
### Install a Specific Version
```yaml
- uses: peaceiris/workflows/setup-goreleaser@v0.21.2
with:
goreleaser-version: '1.8.1'
```
## Setup [ko-build/ko]
Install `ko` to a GitHub Actions Ubuntu or macOS virtual environment.
Definition: [setup-ko/action.yml](https://github.com/peaceiris/workflows/blob/main/setup-ko/action.yml)
[ko-build/ko]: https://github.com/ko-build/ko
### Install the Latest Version
Here is an example GitHub Actions workflow to install the latest `ko` and run it.
```yaml
name: CI
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: peaceiris/workflows/setup-ko@v0.21.2
- run: ko version
```
### Install a Specific Version
```yaml
- uses: peaceiris/workflows/setup-ko@v0.21.2
with:
ko-version: '0.17.1'
```
## Setup [magefile/mage]
Install `mage` to a GitHub Actions Ubuntu virtual environment.
Definition: [setup-mage/action.yml](https://github.com/peaceiris/workflows/blob/main/setup-mage/action.yml)
[magefile/mage]: https://github.com/magefile/mage
### Install the Latest Version
Here is an example GitHub Actions workflow to install the latest `mage` and run it.
```yaml
name: CI
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: peaceiris/workflows/setup-mage@v0.21.2
- run: mage -h
- run: mage fmt
```
### Install a Specific Version
```yaml
- uses: peaceiris/workflows/setup-mage@v0.21.2
with:
mage-version: '1.10.0'
```
## Reusable hadolint workflow
```yaml
jobs:
hadolint:
uses: peaceiris/workflows/.github/workflows/hadolint.yml@v0.21.2
```
## Reusable actionlint workflow
```yaml
jobs:
actionlint:
uses: peaceiris/workflows/.github/workflows/actionlint.yml@v0.21.2
```
## Reusable pull-request merger workflow
```yaml
name: pull-request
on:
issue_comment:
types: [created, edited]
jobs:
merger:
uses: peaceiris/workflows/.github/workflows/merger.yml@v0.21.2
```