Skip to content

Commit

Permalink
WIP: add composite actions
Browse files Browse the repository at this point in the history
  • Loading branch information
beuluis committed Dec 17, 2024
1 parent e2b873b commit 1722427
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions .github/actions/upload-to-s3/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,46 @@ name: 'Upload to S3'
description: 'Uploads files to S3'

Check failure on line 2 in .github/actions/upload-to-s3/action.yml

View workflow job for this annotation

GitHub Actions / yamllint

2:14 [quoted-strings] string value is redundantly quoted with double quotes

inputs:
aws_access_key_id:
access_key:
description: 'AWS Access Key ID'

Check failure on line 6 in .github/actions/upload-to-s3/action.yml

View workflow job for this annotation

GitHub Actions / yamllint

6:18 [quoted-strings] string value is redundantly quoted with double quotes
required: true
aws_region:
description: 'AWS Region'
required: false
default: 'US'
aws_secret_access_key:
secret_key:
description: 'AWS Secret Access Key'

Check failure on line 9 in .github/actions/upload-to-s3/action.yml

View workflow job for this annotation

GitHub Actions / yamllint

9:18 [quoted-strings] string value is redundantly quoted with double quotes
required: true
endpoint_url:
endpoint:
description: 'AWS endpoint URL'

Check failure on line 12 in .github/actions/upload-to-s3/action.yml

View workflow job for this annotation

GitHub Actions / yamllint

12:18 [quoted-strings] string value is redundantly quoted with double quotes
required: false
default: ''

Check failure on line 14 in .github/actions/upload-to-s3/action.yml

View workflow job for this annotation

GitHub Actions / yamllint

14:14 [quoted-strings] string value is not quoted with double quotes
path_to_upload:
source_path:
description: 'Path to the files to upload'

Check failure on line 16 in .github/actions/upload-to-s3/action.yml

View workflow job for this annotation

GitHub Actions / yamllint

16:18 [quoted-strings] string value is redundantly quoted with double quotes
required: true
s3_bucket:
description: 'S3 bucket name'
bucket_name:
description: 'Bucket name'

Check failure on line 19 in .github/actions/upload-to-s3/action.yml

View workflow job for this annotation

GitHub Actions / yamllint

19:18 [quoted-strings] string value is redundantly quoted with double quotes
required: true
target_path:
destination_path:
description: 'Target path within the S3 bucket'

Check failure on line 22 in .github/actions/upload-to-s3/action.yml

View workflow job for this annotation

GitHub Actions / yamllint

22:18 [quoted-strings] string value is redundantly quoted with double quotes
required: false
default: ${{ github.event.repository.name }}

runs:
using: "composite"

Check failure on line 27 in .github/actions/upload-to-s3/action.yml

View workflow job for this annotation

GitHub Actions / yamllint

27:10 [quoted-strings] string value is redundantly quoted with double quotes
steps:
- name: Install s3cmd
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y s3cmd
- name: Configure s3cmd
shell: bash
run: |
echo "[default]" > ~/.s3cfg
echo "access_key = ${{ inputs.aws_access_key_id }}" >> ~/.s3cfg
echo "secret_key = ${{ inputs.aws_secret_access_key }}" >> ~/.s3cfg
echo "host_base = ${{ inputs.endpoint_url }}" >> ~/.s3cfg
echo "host_bucket = %(bucket)s.${{ inputs.endpoint_url }}" >> ~/.s3cfg
echo "access_key = ${{ inputs.access_key }}" >> ~/.s3cfg
echo "secret_key = ${{ inputs.secret_key }}" >> ~/.s3cfg
echo "host_base = ${{ inputs.endpoint }}" >> ~/.s3cfg
echo "host_bucket = %(bucket)s.${{ inputs.endpoint }}" >> ~/.s3cfg
- name: Deploy to S3-compatible storage
shell: bash
run: |
s3cmd sync ${{ inputs.path_to_upload }} s3://${{ inputs.s3_bucket }}/${{ inputs.target_path }} --delete
s3cmd sync ${{ inputs.source_path }} s3://${{ inputs.bucket_name }}/${{ inputs.destination_path }} --delete

0 comments on commit 1722427

Please sign in to comment.