Skip to content

Commit 4a3f368

Browse files
committed
chore: update readme
1 parent cdf8b2b commit 4a3f368

File tree

1 file changed

+60
-3
lines changed

1 file changed

+60
-3
lines changed

README.md

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<p align="center">
2-
<a href="https://github.com/status-base/upload-file-to-supabase-storage/actions"><img alt="upload-file-to-supabase-storage status" src="https://github.com/status-base/upload-file-to-supabase-storage/workflows/build-test/badge.svg"></a>
2+
<a href="https://github.com/status-base/upload-file-to-supabase-storage/actions/workflows/test.yml"><img alt="upload-file-to-supabase-storage status" src="https://github.com/status-base/upload-file-to-supabase-storage/actions/workflows/test.yml/badge.svg"></a>
33
</p>
44

55
# Upload file to Supabase Storage
@@ -8,20 +8,77 @@ You may want to perform some screenshot, or generate txt file and store those da
88

99
## Inputs
1010

11+
### `file_path`
12+
13+
Path name of the file to be uploaded.
14+
15+
eg: "public/screenshots.png"
16+
1117
### `bucket`
1218

13-
### `file_path`
19+
Name of the bucket to upload to
20+
21+
eg: "screenshot"
1422

1523
### `content_type`
1624

25+
[Supabase Storage](https://supabase.com/docs/reference/javascript/storage-from-upload#parameters) `from.upload` fileOptions parameter, the `Content-Type` header value.
26+
27+
eg: "image/png"
28+
1729
### `cache_control`
1830

31+
[Supabase Storage](https://supabase.com/docs/reference/javascript/storage-from-upload#parameters) `from.upload` fileOptions parameter, the `Content-Control` value.
32+
33+
eg: "3600"
34+
1935
### `upsert`
2036

37+
[Supabase Storage](https://supabase.com/docs/reference/javascript/storage-from-upload#parameters) `from.upload` fileOptions parameter, the `Upsert` value.
38+
39+
eg: "true"
40+
2141
## Env
2242

2343
### `SUPABASE_URL`
2444

45+
Go to [Dashboard Settings](https://app.supabase.com/project/<your-project-ref>/settings/api), copy and paste the **URL** into GitHub Repo's secret.
46+
2547
### `SUPABASE_ANON_KEY`
2648

27-
WIP
49+
Go to [Dashboard Settings](https://app.supabase.com/project/<your-project-ref>/settings/api), copy and paste the **Anon Key** into GitHub Repo's secret.
50+
51+
## Usage/Example
52+
53+
In `.github/workflows/screenshot.yml`
54+
55+
```yml
56+
name: Screenshot Action
57+
on:
58+
push:
59+
branches: -master
60+
61+
env:
62+
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
63+
SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }}
64+
65+
jobs:
66+
screenshots:
67+
runs-on: ubuntu-latest
68+
steps:
69+
- uses: actions/checkout@v3
70+
- name: Screenshot Website
71+
id: screenshot
72+
uses: swinton/[email protected]
73+
with:
74+
source: https://github.com
75+
destination: screenshot.png
76+
77+
- name: Upload image to Storage
78+
uses: status-base/[email protected]
79+
with:
80+
file_path: ${{ steps.screenshot.outputs.path }} // generated from previous step
81+
bucket: website
82+
content_type: image/png
83+
upsert: true
84+
```

0 commit comments

Comments
 (0)