Compare commits
12 Commits
Author | SHA1 | Date |
---|---|---|
![]() |
44c9f09e70 | |
![]() |
68fc785123 | |
![]() |
3afecdfe52 | |
![]() |
281bdfb13d | |
![]() |
355a3e83a2 | |
![]() |
a68b9910d6 | |
![]() |
44bb614a8b | |
![]() |
074a496f4e | |
![]() |
04c4ba64c6 | |
![]() |
9d6c3b12aa | |
![]() |
31cc74168f | |
![]() |
22bd84f71e |
|
@ -0,0 +1,19 @@
|
|||
name: Auto Assign
|
||||
on:
|
||||
issues:
|
||||
types: [opened]
|
||||
pull_request:
|
||||
types: [opened]
|
||||
jobs:
|
||||
run:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: 'Auto-assign issue'
|
||||
uses: pozil/auto-assign-issue@v1
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
assignees: opa-oz
|
||||
numOfAssignee: 1
|
|
@ -3,12 +3,10 @@ LABEL authors="Vladimir <opa_oz> Levin"
|
|||
|
||||
RUN curl https://dl.min.io/client/mc/release/linux-amd64/mc \
|
||||
--create-dirs \
|
||||
-o $HOME/minio-binaries/mc
|
||||
|
||||
RUN chmod +x $HOME/minio-binaries/mc
|
||||
|
||||
RUN export PATH=$PATH:$HOME/minio-binaries/
|
||||
-o /minio-binaries/mc
|
||||
RUN chmod +x /minio-binaries/mc
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
26
README.md
26
README.md
|
@ -1,27 +1,39 @@
|
|||
# MinIO Upload Github Action
|
||||
# Yet another MinIO Upload GitHub Action
|
||||
|
||||
🥳Check also [Yet another MinIO Download GitHub Action](https://github.com/yakubique/minio-download)
|
||||
|
||||
Runs [minio client](https://min.io/docs/minio/linux/reference/minio-mc.html) to upload file(s) to MinIO (self-hosted as well)
|
||||
|
||||
## Tricky part
|
||||
_Technically_ this action can be used with different S3-compatible services, but it **needs tuning**
|
||||
|
||||
### MinIO
|
||||
1. You should have a leading slash at the start of `target`
|
||||
2. You should include filename/dirname into `target`. If you have `source=./directory` and `target=/subdir/directory`, it would be nested - `/subdir/directory/directory`
|
||||
|
||||
### Yandex Cloud
|
||||
1. For Ya.Cloud you **have to** include filename/dirname into `target`, otherwise you will get an empty `target`. Example: `source=directory; target=/test` leads to empty `/test`, but `source=directory; target=/test/directory` would upload as expected.
|
||||
|
||||
## Usage
|
||||
|
||||
1. Upload a file
|
||||
```yaml
|
||||
- name: Upload to MinIO
|
||||
uses: yakubique/minio-upload@v1
|
||||
uses: yakubique/minio-upload@v1.1.3
|
||||
with:
|
||||
endpoint: ${{ secrets.MINIO_ENDPOINT }}
|
||||
access_key: ${{ secrets.MINIO_ACCESS_KEY }}
|
||||
secret_key: ${{ secrets.MINIO_SECRET_KEY }}
|
||||
bucket: my_bucket_name
|
||||
source: ./my-build-1-0-1.tar.gz
|
||||
source: ./my-build-1-1-0.tar.gz
|
||||
# Leading slash is required
|
||||
target: '/builds'
|
||||
```
|
||||
|
||||
2. Upload a directory
|
||||
```yaml
|
||||
- name: Upload to MinIO
|
||||
uses: yakubique/minio-upload@v1
|
||||
- name: Upload a directory to MinIO
|
||||
uses: yakubique/minio-upload@v1.1.3
|
||||
with:
|
||||
endpoint: ${{ secrets.MINIO_ENDPOINT }}
|
||||
access_key: ${{ secrets.MINIO_ACCESS_KEY }}
|
||||
|
@ -29,7 +41,7 @@ Runs [minio client](https://min.io/docs/minio/linux/reference/minio-mc.html) to
|
|||
bucket: my_bucket_name
|
||||
source: ./public
|
||||
# Leading slash is required
|
||||
target: '/my-awesome-site/public'
|
||||
target: '/my-awesome-site'
|
||||
# If you omit the `recursive` argument, action only copies objects in the top level of the specified directory.
|
||||
recursive: true
|
||||
```
|
||||
|
@ -37,7 +49,7 @@ Runs [minio client](https://min.io/docs/minio/linux/reference/minio-mc.html) to
|
|||
3. Upload to the insecure MinIO instance (_http-only_)
|
||||
```yaml
|
||||
- name: Upload to MinIO
|
||||
uses: yakubique/minio-upload@v1
|
||||
uses: yakubique/minio-upload@v1.1.3
|
||||
with:
|
||||
endpoint: ${{ secrets.MINIO_ENDPOINT }}
|
||||
access_key: ${{ secrets.MINIO_ACCESS_KEY }}
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
name: MinIO Upload
|
||||
name: Yet another MinIO Upload
|
||||
description: Upload file(s) to MinIO instance (self-hosted as well)
|
||||
author: "Vladimir <opa_oz> Levin"
|
||||
branding:
|
||||
icon: upload-cloud
|
||||
color: purple
|
||||
inputs:
|
||||
endpoint:
|
||||
description: MinIO endpoint (use `insecure=true` for HTTP-only)
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
et -euxo pipefail
|
||||
#!/bin/sh -l
|
||||
|
||||
export PATH=$PATH:/minio-binaries/
|
||||
|
||||
insecure_option=""
|
||||
if [[ "$YA_INSECURE" == "true" ]]; then
|
||||
|
@ -6,10 +8,9 @@ if [[ "$YA_INSECURE" == "true" ]]; then
|
|||
fi
|
||||
|
||||
recursive_option=""
|
||||
if [[ "$YA_INSECURE" == "true" ]]; then
|
||||
if [[ "$YA_RECURSIVE" == "true" ]]; then
|
||||
recursive_option="--recursive"
|
||||
fi
|
||||
|
||||
mc alias set ${insecure_option:+"$insecure_option"} target "$YA_ENDPOINT" "$YA_ACCESS_KEY" "$YA_SECRET_KEY"
|
||||
|
||||
mc ${insecure_option:+"$insecure_option"} cp ${recursive_option:+"$recursive_option"} $1 "target/$2"
|
Loading…
Reference in New Issue