Skip to content

status-base/upload-file-to-supabase-storage

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

upload-file-to-supabase-storage status

Upload file to Supabase Storage

You may want to perform some screenshot, or generate txt file and store those data to Supabase Bucket, and this is the tools for you!

Inputs

file_path

Path name of the file to be uploaded.

eg: "public/screenshots.png"

bucket

Name of the bucket to upload to

eg: "screenshot"

content_type

Supabase Storage from.upload fileOptions parameter, the Content-Type header value.

eg: "image/png"

cache_control

Supabase Storage from.upload fileOptions parameter, the Content-Control value.

eg: "3600"

upsert

Supabase Storage from.upload fileOptions parameter, the Upsert value.

eg: "true"

Env

SUPABASE_URL

Go to Dashboard Settings, copy and paste the URL into GitHub Repo's secret.

SUPABASE_ANON_KEY

Go to Dashboard Settings, copy and paste the Anon Key into GitHub Repo's secret.

Usage/Example

In .github/workflows/screenshot.yml

name: Screenshot Action
on:
  push:
    branches: -master

env:
  SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
  SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }}

jobs:
  screenshots:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Screenshot Website
        id: screenshot
        uses: swinton/[email protected]
        with:
          source: https://github.com
          destination: screenshot.png

      - name: Upload image to Storage
        uses: status-base/[email protected]
        with:
          file_path: ${{ steps.screenshot.outputs.path }}  // generated from previous step
          bucket: website
          content_type: image/png
          upsert: true