You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+47-7Lines changed: 47 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,49 @@
2
2
3
3
This Action wraps the [Sanity CLI](https://github.com/sanity-io/sanity) for usage inside workflows.
4
4
5
+
## Breaking change in `v0.3`
6
+
7
+
Prior to `v0.3`, all `args` would be appended to the `sanity` command in entrypoint.sh (meaning one or more `args` was required).
8
+
9
+
As of `v0.3`, entrypoint.sh requires at least two `args`. The first is used to specify the current directory (`.`) or a subdirectory (e.g., `studio`, as with a monorepo). All subsequent `args` are appended to the `sanity` command.
10
+
11
+
### Sample deployment snippet
12
+
13
+
Example snippet to run `sanity deploy`, where the studio is installed in a `studio` subdirectory (see below for full example):
14
+
15
+
```yaml
16
+
# deploy-sanity-studio.yml
17
+
18
+
# ... other workflow commands ...
19
+
20
+
with:
21
+
args: studio deploy
22
+
```
23
+
24
+
This is _not_ running a command called `studio deploy`. Rather, it is running `cd studio` followed by `sanity deploy`.
25
+
26
+
---
27
+
28
+
### Sample backup snippet
29
+
30
+
Example snippet to run `sanity dataset export production backups/backup.tar.gz`, where the studio is installed at the root of the repository (see below for full example):
31
+
32
+
```yaml
33
+
# sanity-backup.yml
34
+
35
+
# ... other workflow commands ...
36
+
37
+
with:
38
+
args: . dataset export production backups/backup.tar.gz
39
+
```
40
+
41
+
This will run `cd .` (remaining at the root of the repository) followed by `sanity dataset export production backups/backup.tar.gz`.
42
+
5
43
## Usage
6
44
7
45
Below are two examples of usage. Do you use this GitHub Action for a different purpose? Submit a pull request!
8
46
9
-
Depending on your use case, you will need to [generate a read or write token](https://www.sanity.io/docs/http-auth#robot-tokens-4c21d7b829fe) from your project's management console and then [add it as a secret](https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository) in the Studio GitHub repository. In the examples below, the secret was named `SANITY_AUTH_TOKEN`.
47
+
Depending on your use case, you will need to [generate a read or write token](https://www.sanity.io/docs/http-auth#4c21d7b829fe) from your project's management console and then [add it as a secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) in the Studio GitHub repository. In the examples below, the secret was named `SANITY_AUTH_TOKEN`.
If your studio is in a subdirectory, replace `.` in `args` with the name of your subdirectory (e.g., `args: studio deploy`)
72
+
33
73
### Backup routine
34
74
35
-
Thanks to [scheduled events](https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#schedule) and [artifacts](https://docs.github.com/en/free-pro-team@latest/actions/guides/storing-workflow-data-as-artifacts), you can set up a simple backup routine.
75
+
Thanks to [scheduled events](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule) and [artifacts](https://docs.github.com/en/actions/advanced-guides/storing-workflow-data-as-artifacts), you can set up a simple backup routine.
36
76
37
-
Backup files will appear as downloadable artifacts in the workflow summary. Keep in mind that artifacts are automatically deleted [after a certain period of time](https://docs.github.com/en/free-pro-team@latest/actions/reference/usage-limits-billing-and-administration#artifact-and-log-retention-policy) (after 90 days for public repositories).
77
+
Backup files will appear as downloadable artifacts in the workflow summary. Keep in mind that artifacts are automatically deleted [after a certain period of time](https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration#artifact-and-log-retention-policy) (after 90 days by default for public repositories).
0 commit comments