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
feat: review frontend examples for deployment (#578)
* feat: review frontend examples for deployment
Signed-off-by: David Dal Busco <david.dalbusco@outlook.com>
* 📄 Update LLMs.txt snapshot for PR review
---------
Signed-off-by: David Dal Busco <david.dalbusco@outlook.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
@@ -171,40 +169,36 @@ you to focus on exploring and customizing your app right away.
171
169
172
170
---
173
171
174
-
## Hosting
175
-
176
-
If you already have an [Angular](https://angular.dev/) app, you're all set — proceed to the [Deployment](#deployment) section to upload your project to production.
177
-
178
-
Otherwise, you can bootstrap a new website using the Juno template by running the following command:
When you create the satellite using juno build, a `satelliteId` is generated. This `satelliteId` must be copied into the `src/environments/environment.prod.ts` file.
180
+
### 2. Configure your project
200
181
201
-
2. Configure the dist folder correctly:
202
-
In Angular, the build artifacts are not always placed directly under the `dist` folder. Instead, they may be located at `dist/<application-name>` or `dist/<application-name>/browser`. When running `juno config init`, you need to provide the full path to ensure that `juno hosting deploy` works as expected.
182
+
Create a `juno.config.mjs` file at the root of your project. Replace the `PROD_SATELLITE_ID` with the ID of the Satellite you created earlier and `dist/<application-name>/browser` with your project's name.
@@ -166,28 +162,36 @@ import WhatsNext from "./components/whats-next.md";
166
162
167
163
---
168
164
169
-
## Hosting
165
+
## Deployment
170
166
171
-
If you already have an [Astro](https://astro.build/) app, you're all set — proceed to the [Deployment](#deployment) section to upload your project to production.
167
+
Use this guide to deploy and host your project to production.
172
168
173
-
Otherwise, you can bootstrap a new website using the Juno template by running the following command:
169
+
import CreateSatellite from "./components/create-satellite.mdx";
You can deploy using either [GitHub Actions](#github-actions-deployment) or [CLI](#cli-deployment) (command line interface).
6
+
7
+
#### GitHub Actions deployment
8
+
9
+
1. From your Satellite's overview, navigate to the **Setup** tab.
10
+
11
+
2. Click on **Add an access key**.
12
+
13
+
3. Generate a new key with the default option. Click **Submit**.
14
+
15
+
4. Upon successful creation, a **Secret token** will be displayed. Copy the value and save it as an [encrypted secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets) in your GitHub repository or organization, using the key `JUNO_TOKEN`.
16
+
17
+
5. Create a `deploy.yml` file in the `.github/workflows` subfolder of your repo.
18
+
19
+
6. Add the following workflow configuration:
20
+
21
+
```yaml title=".github/workflows/deploy.yml"
22
+
name: Deploy to Juno
23
+
24
+
on:
25
+
workflow_dispatch:
26
+
push:
27
+
branches: [main]
28
+
29
+
jobs:
30
+
deploy:
31
+
runs-on: ubuntu-latest
32
+
steps:
33
+
- name: Check out the repo
34
+
uses: actions/checkout@v4
35
+
36
+
- uses: actions/setup-node@v4
37
+
with:
38
+
node-version: 24
39
+
registry-url: "https://registry.npmjs.org"
40
+
41
+
- name: Install Dependencies
42
+
run: npm ci
43
+
44
+
- name: Deploy to Juno
45
+
uses: junobuild/juno-action@main
46
+
with:
47
+
args: hosting deploy
48
+
env:
49
+
JUNO_TOKEN: ${{ secrets.JUNO_TOKEN }}
50
+
```
51
+
52
+
#### CLI deployment
53
+
54
+
1. Install the CLI
55
+
56
+
import Cli from "./cli.mdx";
57
+
58
+
<Cli />
59
+
60
+
2. Authenticate the CLI. This will open the Juno Console.
61
+
62
+
```bash
63
+
juno login
64
+
```
6
65
7
-
If you haven't created a satellite yet, go ahead and [create](../../create-a-satellite.mdx) a new one in the Juno's console.
66
+
:::tip
8
67
9
-
### {props.index+1}. Deploy
68
+
An access token is used to identify your terminal. That's why the CLI asks whether you want to encrypt it with a password.
69
+
For security reasons, it's recommended that you do so.
10
70
11
-
Once your satellite is up and running, you can proceed with uploading your app.
71
+
:::
12
72
13
-
You can either automate your deployment with GitHub Actions (recommended) or deploy manually from your device. Choose your method:
73
+
3. In the browser window, click **Authorize** to grant permission.
@@ -175,32 +173,22 @@ you to focus on exploring and customizing your app right away.
175
173
176
174
---
177
175
178
-
## Hosting
179
-
180
-
If you already have an [Next.js](https://nextjs.org/) app, you're all set — proceed to the [Deployment](#deployment) section to upload your project to production.
181
-
182
-
Otherwise, you can bootstrap a new website using the Juno template by running the following command:
Once you’re set up, continue to the [Deployment](#deployment) section below.
191
-
192
-
---
193
-
194
176
## Deployment
195
177
196
-
Use this guide to deploy your project to production — directly to a satellite on mainnet.
178
+
Use this guide to deploy and host your project to production.
197
179
198
180
### 1. Static exports
199
181
200
182
The Internet Computer, including Juno, currently does not support Server Side Rendering (_without workaround_). Therefore, it is recommended to generate a pre-rendered or client-side-only frontend application.
201
183
202
184
We suggest using the [static exports](https://nextjs.org/docs/pages/building-your-application/deploying/static-exports) option from Next.js.
203
185
186
+
:::note
187
+
188
+
If you’re using the official Juno [Next.js plugin](../reference/plugins.mdx#nextjs-plugin), static exports are already configured for you.
0 commit comments