S3 Uploader for GitHub Actions
Learn how to configure S3 Uploader for GitHub Actions for use with Filebase.

What is S3 Uploader for GitHub Actions?

S3 Uploader for GitHub Actions is an open source GitHub Action that enables developers to configure automatic backups for their GitHub repositories to an S3-compatible service like Filebase whenever their GitHub repository’s main branch is pushed or updated by a pull request.
This GitHub Action source code can be found here.
Read below to learn how to configure S3 Uploader for GitHub Actions with Filebase.

Prerequisites:

  • Have your Filebase Access and Secret Keys. Learn how to view your access keys here.
  • Create a Filebase Bucket. Learn how to create a bucket here.

1. Create a GitHub repository, or navigate to an existing repository. Select the 'Settings' tab.

2. From the left side bar menu, select 'Secrets', then 'Actions', then click the button 'New Repository Secret':

3. Create a new secret called FILEBASE_ACCESS_KEY. Enter your Filebase Access Key for the value of this secret.

4. Repeat this step to create a second secret called FILEBASE_SECRET_KEY. Enter your Filebase Secret Key for the value of this second secret.

5. Select ‘Actions’ from the top menu bar.

5. In the GitHub Actions menu, select ‘Set Up a Workflow Yourself”

7. Enter the following code into the new file, by default called ‘main.yml’:

1
# This is a basic workflow to help you get started with Actions
2
3
name: CI
4
5
# Controls when the workflow will run
6
on:
7
# Triggers the workflow on push or pull request events but only for the main branch
8
push:
9
branches: [ main ]
10
pull_request:
11
branches: [ main ]
12
13
# Allows you to run this workflow manually from the Actions tab
14
workflow_dispatch:
15
16
jobs:
17
upload-s3-parts:
18
runs-on: ubuntu-latest
19
steps:
20
- name: checkout
21
uses: actions/[email protected]
22
23
- name: install node 16
24
uses: actions/setup-[email protected]
25
with:
26
node-version: 16.x
27
28
- name: S3 Uploader for GitHub Actions
29
uses: Noelware/s3-[email protected]
30
with:
31
directories: '*'
32
endpoint: https://s3.filebase.com
33
bucket: github-test-bucket
34
access-key: ${{ secrets.FILEBASE_ACCESS_KEY }}
35
secret-key: ${{ secrets.FILEBASE_SECRET_KEY }}
Copied!
Replace the following values to match your configuration:
  • Directories: The directories in your GitHub repository you would like to upload to Filebase.
  • Bucket: Your Filebase Bucket Name
In this configuration, all files in our repository are being backed up, and this workflow is configured to be run automatically whenever the main branch is pushed to or merged with a pull request.

8. Then, select ‘Start Commit’ on the right side of the screen. Commit your file.

9. You will then see your main.yml file listed in your repository.

Select the ‘Actions’ tab from the menu bar again to check the status of the GitHub action, which was run automatically when it was committed. From here, it will be run automatically whenever the main branch of your repository is pushed to or merged with a pull request.

10. Your GitHub action will show a green check mark, meaning that it was able to run successfully.

11. You can verify that your GitHub repository files were uploaded to your Filebase bucket by checking the contents of your Filebase bucket on the web console.

If you have any questions, please join our Discord server, or send us an email at [email protected]