mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-25 16:31:13 +00:00
47 lines
1.1 KiB
YAML
47 lines
1.1 KiB
YAML
|
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 }}/
|