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
+80-7Lines changed: 80 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,47 @@
1
1
# Juno Action
2
2
3
-
This GitHub Action for [Juno] enables arbitrary actions with the [command-line client]((https://github.com/junobuild/cli)).
3
+
This GitHub Action for [Juno] enables arbitrary actions with the [command-line client](https://github.com/junobuild/cli).
4
4
5
-
## Environment variables
5
+
## Authentication
6
6
7
-
-`JUNO_TOKEN`: The token to use for authentication. It can be generated through Juno's [console](https://console.juno.build). Prefer a controller with "Read-write" permission rather than administrator.
7
+
The action supports two authentication methods:
8
8
9
-
-`PROJECT_PATH` - **Optional**. The path to the folder containing `juno.config.ts|js|json` if it doesn't exist at the root of your repository. e.g. `./my-app`.
9
+
### 1. GitHub OIDC (Recommended)
10
+
11
+
Authenticate automatically using GitHub's OpenID Connect tokens. No secrets required!
12
+
13
+
**Requirements:**
10
14
11
-
## Example
15
+
- Add `id-token: write` permission to your workflow
16
+
- Configure your Satellite to support automation
12
17
13
-
To deploy a release of your dapp to Juno with a GitHub Action:
18
+
**Example configuration:**
19
+
20
+
```typescript
21
+
import { defineConfig } from"@junobuild/config";
22
+
23
+
exportdefaultdefineConfig({
24
+
satellite: {
25
+
ids: {
26
+
development: "<DEV_SATELLITE_ID>",
27
+
production: "<PROD_SATELLITE_ID>"
28
+
},
29
+
automation: {
30
+
github: {
31
+
repositories: [
32
+
{
33
+
owner: "your-org", // or user name, e.g. peterpeterparker
34
+
name: "your-repo",
35
+
refs: [] // Optional: restrict to specific referencess, e.g. ["refs/heads/main", "refs/pull/47/merge"]
36
+
}
37
+
]
38
+
}
39
+
}
40
+
}
41
+
});
42
+
```
43
+
44
+
**Workflow example:**
14
45
15
46
```yaml
16
47
name: Deploy to Juno
@@ -23,6 +54,11 @@ on:
23
54
jobs:
24
55
deploy:
25
56
runs-on: ubuntu-latest
57
+
58
+
permissions:
59
+
id-token: write # Required for GitHub OIDC
60
+
contents: read
61
+
26
62
steps:
27
63
- name: Check out the repo
28
64
uses: actions/checkout@v4
@@ -38,11 +74,48 @@ jobs:
38
74
- name: Deploy to Juno
39
75
uses: junobuild/juno-action
40
76
with:
41
-
args: deploy
77
+
args: hosting deploy
78
+
```
79
+
80
+
### 2. Token Authentication (Legacy)
81
+
82
+
Use a manually generated token from Juno's console. Prefer an access key with "Read-write" permission rather than administrator.
83
+
84
+
```yaml
85
+
name: Deploy to Juno
86
+
87
+
on:
88
+
workflow_dispatch:
89
+
push:
90
+
branches: [main]
91
+
92
+
jobs:
93
+
deploy:
94
+
runs-on: ubuntu-latest
95
+
steps:
96
+
- name: Check out the repo
97
+
uses: actions/checkout@v4
98
+
99
+
- uses: actions/setup-node@v4
100
+
with:
101
+
node-version: 24
102
+
registry-url: "https://registry.npmjs.org"
103
+
104
+
- name: Install Dependencies
105
+
run: npm ci
106
+
107
+
- name: Deploy to Juno
108
+
uses: junobuild/juno-action
109
+
with:
110
+
args: hosting deploy
42
111
env:
43
112
JUNO_TOKEN: ${{ secrets.JUNO_TOKEN }}
44
113
```
45
114
115
+
## Configuration
116
+
117
+
- `PROJECT_PATH` - **Optional**. The path to the folder containing `juno.config.ts|js|json` if it doesn't exist at the root of your repository. e.g. `./my-app`.
118
+
46
119
## Available Action Versions
47
120
48
121
You can choose from several action variants depending on your needs:
0 commit comments