• Learn
  • November 26, 2026
  • 5 min read

How to upload files to S3 or Cloudflare R2 from GitHub Actions

GitHub's own artifacts are zipped, expire, and need a login to download. When you want a link anyone can open, such as a screenshot in a review, a build for a tester or a report for a client, uploading to your own bucket is simpler. The Aktar upload action does it in one step, with the same naming rules as the Aktar apps.

Add your keys as repository secrets

  1. Create an access key that can write to one bucket only. The setup guides show how for each provider.
  2. In your repository, open Settings › Secrets and variables › Actions and add the access key ID and the secret access key, for example as S3_ACCESS_KEY_ID and S3_SECRET_ACCESS_KEY.

The action masks the secret key in the log.

Upload files in a workflow

- uses: getaktar/upload-action@v1
  id: upload
  with:
    files: |
      dist/*.zip
      reports/summary.html
    provider: r2
    account-id: ${{ secrets.R2_ACCOUNT_ID }}
    bucket: ci-uploads
    public-url: https://files.example.com
    access-key-id: ${{ secrets.S3_ACCESS_KEY_ID }}
    secret-access-key: ${{ secrets.S3_SECRET_ACCESS_KEY }}
    path: "{repo}/{run}/{filename}-{short}.{ext}"

- run: echo "Download: ${{ steps.upload.outputs.url }}"

files takes paths or glob patterns, one per line. provider is r2, s3, b2, spaces, minio or other; for anything but R2, give endpoint (and region on Amazon S3). The links also appear in the job summary.

Post Playwright screenshots on the pull request

on: pull_request
permissions:
  contents: read
  pull-requests: write
jobs:
  e2e:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - run: npx playwright test
      - if: always()
        uses: getaktar/upload-action@v1
        with:
          files: test-results/**/*.png
          fail-on-empty: false
          comment: true
          comment-title: Screenshots
          # ...bucket, keys and public-url as above

The comment shows every image inline and is updated on later runs instead of adding a new one. if: always() uploads the screenshots of failing tests too, which is when you need them most.

Name files your way

path is a template. Besides the usual variables ({year}, {month}, {filename}, {ext}, {short}, {uuid}), the action adds {repo}, {branch}, {sha}, {run} and {attempt}. {short} is a 7-character code that never replaces another file. Without it, a name that's taken gets " 2", " 3" and so on, so nothing is overwritten.

Keep CI uploads from piling up

Put CI files under their own prefix (for example {repo}/{run}/) and add a lifecycle rule on that prefix, so the bucket deletes them after a few weeks. See lifecycle rules.

Or let Aktar handle it

The action is free and open source, and uploads straight from the runner to your bucket: there's no Aktar server in between. On your own computer, the Aktar apps and the aktar command upload to the same bucket with the same naming.

S3 uploader

Common questions

Does it work with Cloudflare R2, Backblaze B2 and MinIO?

Yes: Amazon S3, Cloudflare R2, Backblaze B2, DigitalOcean Spaces, MinIO and other S3-compatible services. See the setup guides.

Can I use temporary AWS credentials?

Yes. Pass session-token along with the keys, for example from aws-actions/configure-aws-credentials with OIDC.

Do the links need the bucket to be public?

They need to open at public-url: a public bucket, a public development URL or your own domain. See custom domains.