6bcb172468da9c3aeffc2805cb4320756dfe8f0a
[openwrt/staging/jow.git] / .github / workflows / upload-file-s3.yml
1 name: Upload File to S3
2
3 on:
4 workflow_call:
5 secrets:
6 s3_access_key:
7 s3_secret_key:
8 inputs:
9 endpoint:
10 required: true
11 type: string
12 bucket:
13 required: true
14 type: string
15 download_id:
16 required: true
17 type: string
18 filename:
19 required: true
20 type: string
21
22 jobs:
23 upload-file-in-s3:
24 name: Upload file in S3
25 runs-on: ubuntu-latest
26
27 steps:
28 - name: Install minio
29 run: |
30 curl https://dl.min.io/client/mc/release/linux-amd64/mc \
31 --create-dirs \
32 -o $GITHUB_WORKSPACE/minio-binaries/mc
33
34 chmod +x $GITHUB_WORKSPACE/minio-binaries/mc
35 echo $GITHUB_WORKSPACE/minio-binaries/ >> $GITHUB_PATH
36
37 - name: Setup minio
38 run: mc alias set s3 ${{ inputs.endpoint }} ${{ secrets.s3_access_key }} ${{ secrets.s3_secret_key }}
39
40 - name: Download file
41 uses: actions/download-artifact@v3
42 with:
43 name: ${{ inputs.download_id }}
44
45 - name: Upload file to s3
46 run: mc cp ${{ inputs.filename }} s3/${{ inputs.bucket }}/