Skip to content

Commit 4c291db

Browse files
docs: update for OIDC support (#79)
1 parent 4849942 commit 4c291db

1 file changed

Lines changed: 80 additions & 7 deletions

File tree

README.md

Lines changed: 80 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,47 @@
11
# Juno Action
22

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).
44

5-
## Environment variables
5+
## Authentication
66

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:
88

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:**
1014

11-
## Example
15+
- Add `id-token: write` permission to your workflow
16+
- Configure your Satellite to support automation
1217

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+
export default defineConfig({
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:**
1445

1546
```yaml
1647
name: Deploy to Juno
@@ -23,6 +54,11 @@ on:
2354
jobs:
2455
deploy:
2556
runs-on: ubuntu-latest
57+
58+
permissions:
59+
id-token: write # Required for GitHub OIDC
60+
contents: read
61+
2662
steps:
2763
- name: Check out the repo
2864
uses: actions/checkout@v4
@@ -38,11 +74,48 @@ jobs:
3874
- name: Deploy to Juno
3975
uses: junobuild/juno-action
4076
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
42111
env:
43112
JUNO_TOKEN: ${{ secrets.JUNO_TOKEN }}
44113
```
45114
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+
46119
## Available Action Versions
47120

48121
You can choose from several action variants depending on your needs:

0 commit comments

Comments
 (0)