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
This feature is available on both [free and pro plans](/pricing) and in [`@nuxthub/core >= v0.9.0`](https://github.com/nuxt-hub/core/releases/tag/v0.9.0).
21
+
::
22
+
23
+
We've been working hard on closing the gap between Pages and Workers, and improving the experience using NuxtHub. With this release, we've brought preview environments to Workers, and improved environment variables management.
24
+
25
+
## Environments
26
+
27
+
When we first introduced Cloudflare Workers support in NuxtHub, we only supported production deployments. Today, we're excited to announce that Workers now has the same powerful environment capabilities as Pages, making it easier than ever to test and deploy your applications. Any deployment from a non-production branch automatically gets deployed to the preview environment with separate resources (database, kv, etc.) than production.
28
+
29
+
::note
30
+
Due to Cloudflare limitations, deployments with the `cloudflare_durable` preset will not receive a unique deployment URL.
31
+
::
32
+
33
+
### Custom Environments
34
+
35
+
We're taking things a step further and introducing the ability to create additional environments beyond just preview and production, such as staging, testing, etc. All environments in NuxtHub have unique resources, making them perfect for testing. NuxtHub allows configuring the branch patterns on custom environments with exact, prefix and suffix, to enable different workflows.
36
+
- Example: The branch `staging` deploys to the staging environment
37
+
- Example: All branches starting with `bugfix/` deploys to a testing environment
38
+
39
+
Get started from the new "Environments" page of NuxtHub Admin.
40
+
41
+
## Revamped environment variables management
42
+
43
+
The biggest challenge faced by users since introducing the NuxtHub GitHub Action as the primary method for deployment was syncing environment variables and secrets to GitHub. Our syncing relied on [environments in GitHub](https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-deployments/managing-environments-for-deployment), which is a paid feature, therefore many NuxtHub users had to manually set environment variables to GitHub. Furthermore, GitHub Actions required specifying every secret used within the workflow which meant there was friction when using secrets, such as `NUXT_UI_PRO_LICENSE`.
44
+
45
+
We've worked hard to resolve this hurdle and to streamline the experience using NuxtHub. Now we're thrilled to introduce [`nuxt-hub/action@v2`](https://github.com/nuxt-hub/action), which now securely pulls environment variables and secrets from NuxtHub Admin, and builds your Nuxt application. On top of this, you can now scope environment variables to be build or runtime only, allowing you to further protect secrets.
46
+
47
+
### Migration guide
48
+
49
+
In order to use the new system, follow our migration guide:
50
+
51
+
1. Update to [`@nuxthub/core >= v0.9.0`](https://github.com/nuxt-hub/core/releases/tag/v0.9.0) on production and preview
52
+
2. Go to Environment Variables within the NuxtHub Admin
53
+
3. Click "Migrate environment variables"
54
+
55
+
#### Migrating to NuxtHub Action v2
56
+
57
+
1. Remove the `environments:` section
58
+
2. Remove the `Build application` section
59
+
3. Upgrade from `nuxt-hub/action@v1` to `nuxt-hub/action@v2`
4. If your Nuxt app is not within the repository root and `directory:` parameter is provided, remove the trailing `/dist`.
111
+
```diff
112
+
- - name: Deploy to NuxtHub
113
+
- uses: nuxt-hub/action@v1
114
+
- with:
115
+
- directory: frontend/dist
116
+
117
+
+ - name: Build & Deploy to NuxtHub
118
+
+ uses: nuxt-hub/action@v2
119
+
+ with:
120
+
+ directory: frontend
121
+
```
122
+
123
+
This release marks a significant milestone in our journey to provide a seamless deployment experience across both Pages and Workers. The introduction of preview environments and improved environment variables management brings feature parity between the two platforms, making it easier than ever to deploy and test your Nuxt applications. We're excited to see how you'll use these new capabilities to streamline your development workflow.
The following input parameters can be provided to the GitHub Action. Learn more about [Workflow syntax for GitHub Actions](https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idstepswith) on GitHub's documentation.
NuxtHub automatically copies all your project's environment variables to your GitHub repository actions environment variables.
211
-
212
-
When encrypting an environment variable in the NuxtHub Admin, a GitHub actions secret will be created in your repository.
213
-
214
-
You can view the environment variables and secrets synchronized by NuxtHub by navigating to **Repository Settings -> Secrets and variables -> Actions** on GitHub.
215
-
216
-
::warning
217
-
If you have a private repository on a free GitHub account or organization, NuxtHub won't be able to sync the env variables & secrets as GitHub repository environments (production / preview) are not available. In this case, you must manually set up the environment variables by navigating to **Repository Settings -> Secrets and variables -> Actions** on GitHub.
0 commit comments