Skip to content

Commit

Permalink
✨ feat: Add workflow to upload files to AWS S3 (#10)
Browse files Browse the repository at this point in the history
# Description

Add a reusable workflow to copy files to an AWS S3 bucket

## Type of change

:sparkles: New feature (non-breaking change which adds functionality)

# Checklist:

- [X] My code follows the style guidelines of this project
- [X] I have performed a self-review of my own code
- [X] I have made corresponding changes to the documentation
- [X] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [X] Any dependent changes have been merged and published in downstream
modules

---------

Co-authored-by: GitHub Action <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
gsuquet and github-actions[bot] authored Dec 13, 2023
1 parent d09986a commit 373c063
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/deployment-s3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Upload files to AWS S3
on:
workflow_call:
inputs:
aws_region:
description: 'AWS region'
required: false
type: string
default: eu-west-1
files_path:
description: 'The path to the files to copy'
required: false
type: string
default: .
artifact_name:
description: 'The name of the artifact to download'
required: false
type: string
secrets:
bucket_path:
required: true
description: The path to the S3 bucket to copy files to
aws_access_key_id:
required: true
description: The AWS access key ID
aws_secret_access_key:
required: true
description: The AWS secret access key

jobs:
upload:
runs-on: ubuntu-latest
steps:
- name: Download artifacts
if: ${{ inputs.artifact_name }}
uses: actions/download-artifact@v3
with:
name: ${{ inputs.artifact_name }}
path: ${{ inputs.files_path }}

- name: Copy files to S3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.aws_access_key_id }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_access_key }}
run: |
aws s3 cp \
--recursive \
--region ${{ inputs.aws_region }} \
${{ inputs.files_path }} \
s3://${{ secrets.bucket_path }}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
| automation | [comment-pr](./.github/workflows/automation-comment-pr.yml) | Add or update a comment on the pull request |
| automation | [greeter](./.github/workflows/automation-greeter.yml) | Greetings |
| automation | [labeler](./.github/workflows/automation-labeler.yml) | Labeler |
| deployment | [s3](./.github/workflows/deployment-s3.yml) | Upload files to AWS S3 |
| integration | [commit-validator](./.github/workflows/integration-commit-validator.yml) | Validate commit or PR title format is correct |
| integration | [linter-pre-commit](./.github/workflows/integration-linter-pre-commit.yml) | Pre-commit |
| integration | [modification-script](./.github/workflows/integration-modification-script.yml) | Execute script and commit changes to git |
Expand Down

0 comments on commit 373c063

Please sign in to comment.