aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/upload-file-s3.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/upload-file-s3.yml')
-rw-r--r--.github/workflows/upload-file-s3.yml46
1 files changed, 46 insertions, 0 deletions
diff --git a/.github/workflows/upload-file-s3.yml b/.github/workflows/upload-file-s3.yml
new file mode 100644
index 0000000000..6bcb172468
--- /dev/null
+++ b/.github/workflows/upload-file-s3.yml
@@ -0,0 +1,46 @@
+name: Upload File to S3
+
+on:
+ workflow_call:
+ secrets:
+ s3_access_key:
+ s3_secret_key:
+ inputs:
+ endpoint:
+ required: true
+ type: string
+ bucket:
+ required: true
+ type: string
+ download_id:
+ required: true
+ type: string
+ filename:
+ required: true
+ type: string
+
+jobs:
+ upload-file-in-s3:
+ name: Upload file in S3
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Install minio
+ run: |
+ curl https://dl.min.io/client/mc/release/linux-amd64/mc \
+ --create-dirs \
+ -o $GITHUB_WORKSPACE/minio-binaries/mc
+
+ chmod +x $GITHUB_WORKSPACE/minio-binaries/mc
+ echo $GITHUB_WORKSPACE/minio-binaries/ >> $GITHUB_PATH
+
+ - name: Setup minio
+ run: mc alias set s3 ${{ inputs.endpoint }} ${{ secrets.s3_access_key }} ${{ secrets.s3_secret_key }}
+
+ - name: Download file
+ uses: actions/download-artifact@v3
+ with:
+ name: ${{ inputs.download_id }}
+
+ - name: Upload file to s3
+ run: mc cp ${{ inputs.filename }} s3/${{ inputs.bucket }}/