Compare commits

..

No commits in common. "main" and "v1.0.2" have entirely different histories.
main ... v1.0.2

4 changed files with 14 additions and 43 deletions

View File

@ -1,19 +0,0 @@
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

View File

@ -3,8 +3,11 @@ LABEL authors="Vladimir <opa_oz> Levin"
RUN curl https://dl.min.io/client/mc/release/linux-amd64/mc \ RUN curl https://dl.min.io/client/mc/release/linux-amd64/mc \
--create-dirs \ --create-dirs \
-o /minio-binaries/mc -o $HOME/minio-binaries/mc
RUN chmod +x /minio-binaries/mc
RUN chmod +x $HOME/minio-binaries/mc
RUN export PATH=$PATH:$HOME/minio-binaries/
COPY entrypoint.sh /entrypoint.sh COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh RUN chmod +x /entrypoint.sh

View File

@ -1,39 +1,27 @@
# Yet another 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) 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 ## Usage
1. Upload a file 1. Upload a file
```yaml ```yaml
- name: Upload to MinIO - name: Upload to MinIO
uses: yakubique/minio-upload@v1.1.3 uses: yakubique/minio-upload@v1
with: with:
endpoint: ${{ secrets.MINIO_ENDPOINT }} endpoint: ${{ secrets.MINIO_ENDPOINT }}
access_key: ${{ secrets.MINIO_ACCESS_KEY }} access_key: ${{ secrets.MINIO_ACCESS_KEY }}
secret_key: ${{ secrets.MINIO_SECRET_KEY }} secret_key: ${{ secrets.MINIO_SECRET_KEY }}
bucket: my_bucket_name bucket: my_bucket_name
source: ./my-build-1-1-0.tar.gz source: ./my-build-1-0-1.tar.gz
# Leading slash is required # Leading slash is required
target: '/builds' target: '/builds'
``` ```
2. Upload a directory 2. Upload a directory
```yaml ```yaml
- name: Upload a directory to MinIO - name: Upload to MinIO
uses: yakubique/minio-upload@v1.1.3 uses: yakubique/minio-upload@v1
with: with:
endpoint: ${{ secrets.MINIO_ENDPOINT }} endpoint: ${{ secrets.MINIO_ENDPOINT }}
access_key: ${{ secrets.MINIO_ACCESS_KEY }} access_key: ${{ secrets.MINIO_ACCESS_KEY }}
@ -41,7 +29,7 @@ _Technically_ this action can be used with different S3-compatible services, but
bucket: my_bucket_name bucket: my_bucket_name
source: ./public source: ./public
# Leading slash is required # Leading slash is required
target: '/my-awesome-site' target: '/my-awesome-site/public'
# If you omit the `recursive` argument, action only copies objects in the top level of the specified directory. # If you omit the `recursive` argument, action only copies objects in the top level of the specified directory.
recursive: true recursive: true
``` ```
@ -49,7 +37,7 @@ _Technically_ this action can be used with different S3-compatible services, but
3. Upload to the insecure MinIO instance (_http-only_) 3. Upload to the insecure MinIO instance (_http-only_)
```yaml ```yaml
- name: Upload to MinIO - name: Upload to MinIO
uses: yakubique/minio-upload@v1.1.3 uses: yakubique/minio-upload@v1
with: with:
endpoint: ${{ secrets.MINIO_ENDPOINT }} endpoint: ${{ secrets.MINIO_ENDPOINT }}
access_key: ${{ secrets.MINIO_ACCESS_KEY }} access_key: ${{ secrets.MINIO_ACCESS_KEY }}

View File

@ -1,6 +1,4 @@
#!/bin/sh -l et -euxo pipefail
export PATH=$PATH:/minio-binaries/
insecure_option="" insecure_option=""
if [[ "$YA_INSECURE" == "true" ]]; then if [[ "$YA_INSECURE" == "true" ]]; then
@ -8,9 +6,10 @@ if [[ "$YA_INSECURE" == "true" ]]; then
fi fi
recursive_option="" recursive_option=""
if [[ "$YA_RECURSIVE" == "true" ]]; then if [[ "$YA_INSECURE" == "true" ]]; then
recursive_option="--recursive" recursive_option="--recursive"
fi fi
mc alias set ${insecure_option:+"$insecure_option"} target "$YA_ENDPOINT" "$YA_ACCESS_KEY" "$YA_SECRET_KEY" 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" mc ${insecure_option:+"$insecure_option"} cp ${recursive_option:+"$recursive_option"} $1 "target/$2"