From cd1a1132c961c720aff2a140caa498d94d509b94 Mon Sep 17 00:00:00 2001 From: Rodolfo Silva Date: Wed, 15 Feb 2023 08:49:53 -0300 Subject: [PATCH] add MinIO action --- Dockerfile | 7 +++++++ README.md | 38 ++++++++++++++++++++++++++++++++++++-- action.yml | 24 ++++++++++++++++++++++++ entrypoint.sh | 11 +++++++++++ 4 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 Dockerfile create mode 100644 action.yml create mode 100755 entrypoint.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e2ae8f3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM docker:stable + +COPY entrypoint.sh /entrypoint.sh + +RUN chmod +x /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/README.md b/README.md index a7a16e0..5f7d52e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,36 @@ -# minio-action -MinIO S3 like +# MinIO Github Action + +This [GitHub Action](https://github.com/features/actions) sets up MinIO instance. + +Docker images source [minio/minio](https://hub.docker.com/r/minio/minio). + +--- + +# Usage + +See [action.yml](action.yml) + +Basic: + +```yaml +- name: Start UP MinIO + uses: infleet/minio-action@v0.0.1 + with: + port: "9000" + version: "latest" + username: "minio" + password: "minio" +``` + +Now you should be able to connect to `MinIO` (S3 api) running at `localhost:9000` + +--- + +## Configurations + +| Name | Default | Required? | Description | +| ---------- | -------- | :-------: | ----------------------------------------------------------------------------------- | +| `version` | `latest` | [ ] | Version of MinIO | +| `port` | `9000` | [ ] | Port to forward the access to MinIO, S3 API like | +| `username` | | [x] | The username used to authenticate to S3 api, common used as `AWS_ACCESS_KEY_ID` | +| `password` | | [x] | The password used to authenticate to S3 api, common used as `AWS_SECRET_ACCESS_KEY` | diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..87e851a --- /dev/null +++ b/action.yml @@ -0,0 +1,24 @@ +name: "minio-action" +description: "SetUP MinIO" +author: "infleet" +branding: + icon: fast-forward + color: blue +inputs: + version: + description: "Version of MinIO" + required: false + default: "latest" + port: + description: "Port to forward the access to MinIO, S3 API like" + required: false + default: "9000" + username: + description: "The username used to authenticate to S3 api, common used as AWS_ACCESS_KEY_ID" + required: true + password: + description: "The password used to authenticate to S3 api, common used as AWS_SECRET_ACCESS_KEY" + required: true +runs: + using: "docker" + image: "Dockerfile" diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..d64b62c --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +sh -c "docker run \ + --rm \ + -d \ + -p \"${INPUT_PORT}:9000\" \ + -e MINIO_ROOT_USER=\"${INPUT_USERNAME}\" \ + -e MINIO_ROOT_PASSWORD=\"${INPUT_PASSWORD}\" \ + minio/minio:${INPUT_VERSION} \ + server /data --address=0.0.0.0:9000 \ +" \ No newline at end of file