-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
133 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
commit-message: | ||
prefix: ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- "**.md" | ||
pull_request: | ||
paths-ignore: | ||
- "**.md" | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
setup-docker: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: ./setup-docker | ||
- run: docker version | ||
- run: docker compose version | ||
- run: docker buildx version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,58 @@ A collection of composite run steps GitHub Actions. | |
|
||
|
||
## 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-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: peaceiris/workflows/[email protected] | ||
- run: docker compose version | ||
- run: docker buildx version | ||
``` | ||
### Install a Specific Version | ||
```yaml | ||
name: CI | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: peaceiris/workflows/[email protected] | ||
with: | ||
compose-version: '2.0.1' | ||
buildx-version: '0.6.3' | ||
- run: docker compose version | ||
- run: docker buildx version | ||
``` | ||
## Setup Go Project | ||
This composite action includes the following actions: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: 'Setup Docker' | ||
description: 'A composite action to setup Docker project.' | ||
inputs: | ||
compose-version: | ||
description: 'Set a compose version (>= 2.0.0), e.g. 2.0.1' | ||
default: 'latest' | ||
required: false | ||
buildx-version: | ||
description: 'Set a buildx version, e.g. 0.6.3' | ||
default: 'latest' | ||
required: false | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Prepare .docker | ||
shell: bash | ||
run: | | ||
mkdir -p "${HOME}/.docker/cli-plugins" | ||
- run: docker version | ||
shell: bash | ||
|
||
- name: Install docker compose | ||
shell: bash | ||
run: | | ||
if [ "${{ inputs.compose-version }}" = "latest" ]; then | ||
COMPOSE_VERSION=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | jq -r '.tag_name') | ||
else | ||
COMPOSE_VERSION="${{ inputs.compose-version }}" | ||
fi | ||
curl --silent -L "https://github.com/docker/compose/releases/download/v${COMPOSE_VERSION#v}/docker-compose-$(uname -s)-$(uname -m)" \ | ||
-o "${HOME}/.docker/cli-plugins/docker-compose" | ||
chmod a+x "${HOME}/.docker/cli-plugins/docker-compose" | ||
- run: docker compose version | ||
shell: bash | ||
|
||
- name: Install docker buildx | ||
shell: bash | ||
run: | | ||
if [ "${{ inputs.buildx-version }}" = "latest" ]; then | ||
BUILDX_VERSION=$(curl -s https://api.github.com/repos/docker/buildx/releases/latest | jq -r '.tag_name') | ||
else | ||
BUILDX_VERSION="${{ inputs.buildx-version }}" | ||
fi | ||
curl --silent -L "https://github.com/docker/buildx/releases/download/v${BUILDX_VERSION#v}/buildx-v${BUILDX_VERSION#v}.linux-amd64" \ | ||
-o "${HOME}/.docker/cli-plugins/docker-buildx" | ||
chmod a+x "${HOME}/.docker/cli-plugins/docker-buildx" | ||
- run: docker buildx version | ||
shell: bash |