Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

docs: update deployment urls & azure instructions #4193

Merged
merged 2 commits into from
Apr 8, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
docs: update deployment urls & azure instructions
  • Loading branch information
danielroe committed Apr 8, 2022
commit 05733da2e48b0a1218dda3c0ef37b452df217f0a
132 changes: 66 additions & 66 deletions docs/content/2.guide/5.deployment/1.azure.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,69 @@ icon: LogoAzure

# Azure

How to deploy Nuxt to Azure Static Web Apps or Azure Functions.
How to deploy to Azure Static Web Apps or Azure Functions with Nitro.

## Azure Static Web Apps

How to deploy to Azure Static Web Apps with Nitro.

::list

- Support for serverless SSR build
- Auto-detected when deploying
- Minimal configuration required
::

### Setup

Azure Static Web Apps are designed to be deployed continuously in a [GitHub Actions workflow](https://docs.microsoft.com/en-us/azure/static-web-apps/github-actions-workflow). By default, Nitro will detect this deployment environment and enable the `azure` preset.

### Local preview

You can invoke a development environment to preview before deploying.

```bash
NITRO_PRESET=azure yarn build
npx @azure/static-web-apps-cli start .output/public --api-location .output/server
```

### Deploy from CI/CD via GitHub Actions

When you link your GitHub repository to Azure Static Web Apps, a workflow file is added to the repository.

When you are asked to select your framework, select custom and provide the following information:

| Input | Value |
| --- | --- |
| **app_location** | '/' |
| **api_location** | '.output/server' |
| **output_location** | '.output/public' |

If you miss this step, you can always find the build configuration section in your workflow and update the build configuration:

```yml{}[.github/workflows/azure-static-web-apps-<RANDOM_NAME>.yml]
###### Repository/Build Configurations ######
app_location: '/'
api_location: '.output/server'
output_location: '.output/public'
###### End of Repository/Build Configurations ######
```

#### Note

Pending an update in the [Azure Static Web Apps workflow](https://github.com/Azure/static-web-apps-deploy), you will also need to run the following in your root directory:

```bash
mkdir -p .output/server
touch .output/server/.gitkeep
git add -f .output/server/.gitkeep
```

That's it! Now Azure Static Web Apps will automatically deploy your Nitro-powered Nuxt application on push.

### Demo

A live demo is available on https://icy-pond-008be3f03.1.azurestaticapps.net/

## Azure Functions

Expand Down Expand Up @@ -36,7 +98,7 @@ Install [Azure Functions Core Tools](https://docs.microsoft.com/en-us/azure/azur
You can invoke a development environment from the serverless directory.

```bash
NITRO_PRESET=azure_functions yarn build
NITRO_PRESET=azure-functions yarn build
cd .output
func start
```
Expand Down Expand Up @@ -103,7 +165,7 @@ jobs:
- name: Build
run: npm run build
env:
NITRO_PRESET: azure_functions
NITRO_PRESET: azure-functions

- name: 'Deploy to Azure Functions'
uses: Azure/functions-action@v1
Expand All @@ -119,66 +181,4 @@ Consider [turning on immutable packages](https://docs.microsoft.com/en-us/azure/

### Demo

A live demo is available on <https://nuxt-nitro.azurewebsites.net/>

## Azure Static Web Apps

::alert{type=warning icon=🚧}
Azure Static Web Apps currently defaults to a Node.js 12.x runtime, which means it is not currently compatible with Nuxt Nitro. For now, you can deploy via [Azure Functions](#azure-functions) instead.
::

How to deploy Nuxt to Azure Static Web Apps with Nuxt Nitro.

::list

- Support for serverless SSR build
- Auto-detected when deploying
- Minimal configuration required
::

### Setup

Azure Static Web Apps are designed to be deployed continuously in a [GitHub Actions workflow](https://docs.microsoft.com/en-us/azure/static-web-apps/github-actions-workflow). By default, Nitro will detect this deployment environment and enable the `azure` preset.

### Local preview

You can invoke a development environment to preview before deploying.

```bash
NITRO_PRESET=azure yarn build
npx @azure/static-web-apps-cli start .output/public --api-location .output/server
```

### Deploy from CI/CD via GitHub Actions

When you link your GitHub repository to Azure Static Web Apps, a workflow file is added to the repository.

When you are asked to select your framework, select custom and provide the following information:

| Input | Value |
| --- | --- |
| **app_location** | '/' |
| **api_location** | '.output/server' |
| **output_location** | '.output/public' |

If you miss this step, you can always find the build configuration section in your workflow and update the build configuration:

```yml{}[.github/workflows/azure-static-web-apps-<RANDOM_NAME>.yml]
###### Repository/Build Configurations ######
app_location: '/'
api_location: '.output/server'
output_location: '.output/public'
###### End of Repository/Build Configurations ######
```

#### Note

Pending an update in the [Azure Static Web Apps workflow](https://github.com/Azure/static-web-apps-deploy), you will also need to run the following in your root directory:

```bash
mkdir -p .output/server
touch .output/server/.gitkeep
git add -f .output/server/.gitkeep
```

That's it! Now Azure Static Web Apps will automatically deploy your Nitro-powered Nuxt application on push.
A live demo is available on <https://nitro-deployment.azurewebsites.net/>.
2 changes: 1 addition & 1 deletion docs/content/2.guide/5.deployment/2.cloudflare.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,4 @@ See [more information on the service worker preset](/guide/deployment/presets/se

## Demo

A live demo is available on <https://nitro-demo.nuxt.workers.dev/>.
A live demo is available on <https://nitro-deployment.pi0.workers.dev>.
2 changes: 1 addition & 1 deletion docs/content/2.guide/5.deployment/3.firebase.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@ firebase deploy

## Demo site

A live demo is available on <https://nitro-demo-dfabe.web.app>.
A live demo is available on <https://nitro-deployment.web.app/>.
2 changes: 1 addition & 1 deletion docs/content/2.guide/5.deployment/4.netlify.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ See [more information on the Lambda preset](/guide/deployment/presets/lambda) fo

## Demo

A live demo is available on <https://nitro-demo.netlify.app/>.
A live demo is available on <https://nitro-deployment.netlify.app/>.