diff --git a/.github/actions/upload-s3/action.yml b/.github/actions/upload-s3/action.yml new file mode 100644 index 00000000..655a43c4 --- /dev/null +++ b/.github/actions/upload-s3/action.yml @@ -0,0 +1,36 @@ +name: Upload S3 + +description: Upload S3 + +inputs: + aws-region: + required: true + type: string + role-to-assume: + required: true + type: string + s3-bucket: + required: true + type: string + path: + required: true + type: string + +runs: + using: composite + steps: + - name: Configure AWS Credentials + # aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 + with: + aws-region: ${{ inputs.aws-region }} + role-to-assume: ${{ inputs.role-to-assume }} + + - name: Upload to S3 + run: | + if [ -d "${{ inputs.path }}" ]; then + aws s3 cp "${{ inputs.path }}" "s3://${{ inputs.s3-bucket }}" --recursive + else + aws s3 cp "${{ inputs.path }}" "s3://${{ inputs.s3-bucket }}" + fi + shell: bash