Skip to content

Commit 67fb252

Browse files
authored
docs: add section for nuxthub deploy in ci/cd
1 parent 7baa56b commit 67fb252

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

docs/content/1.docs/1.getting-started/3.deploy.md

+27
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,33 @@ The command will:
6767
You can also install the [NuxtHub CLI](https://github.com/nuxt-hub/cli) globally with: `npm i -g nuxthub`.
6868
::
6969

70+
### Usage with CI/CD
71+
72+
::tip
73+
If you are using GitHub for your project, jump to the [Github Action](#github-action) section.
74+
::
75+
76+
::important
77+
The `nuxthub deploy` command is designed to run **non-interactively** in CI/CD environments. It won’t prompt for additional input (such as logging in or linking the project). As long as the required environment variables are set, deployment will proceed automatically.
78+
::
79+
80+
To integrate the `nuxthub deploy` command within your CI/CD pipeline, set the following environment variables:
81+
- `NUXT_HUB_PROJECT_KEY` – Your project key available in:
82+
- Your project settings in the [NuxtHub Admin](https://admin.hub.nuxt.com)
83+
- Your `.env` file (if you ran `npx nuxthub link`)
84+
- `NUXT_HUB_USER_TOKEN` – Your personal token, available in **User settings****Tokens** in the [NuxtHub Admin](https://admin.hub.nuxt.com)
85+
86+
**Example command:**
87+
```bash [Terminal]
88+
NUXT_HUB_PROJECT_KEY=<my-project-key> NUXT_HUB_USER_TOKEN=<my-user-token> npx nuxthub deploy
89+
```
90+
91+
This will authenticate your user and link your NuxtHub project for deployment.
92+
93+
::note
94+
For security, **do not hardcode these values**. Instead, store them as environment variables in your CI/CD pipeline.
95+
::
96+
7097
## GitHub Action
7198

7299
After linking a GitHub repository to your project, NuxtHub automatically adds a GitHub Actions workflow to automatically deploy your application on every commit using the [NuxtHub GitHub Action](https://github.com/marketplace/actions/deploy-to-nuxthub).

0 commit comments

Comments
 (0)