chore(docs): improve deployment section (#716)

This commit is contained in:
Sébastien Chopin 2021-10-11 18:35:02 +02:00 committed by GitHub
parent c8dfd61b87
commit 34ebfa0d1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 234 additions and 70 deletions

View File

@ -0,0 +1,3 @@
<template>
<svg width="1em" height="1em" viewBox="0 0 48 48"><g fill="none" stroke="currentColor" strokeWidth="4" strokeLinecap="round" strokeLinejoin="round"><path d="M41.5 10h-6M27.5 6v8M27.5 10h-22M13.5 24h-8M21.5 20v8M43.5 24h-22M41.5 38h-6M27.5 34v8M27.5 38h-22" /></g></svg>
</template>

View File

@ -0,0 +1,46 @@
<template>
<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M34.7247 6.81672H61.8476L33.6914 90.2407C33.402 91.0979 32.8511 91.8428 32.1161 92.3705C31.3812 92.8982 30.4993 93.1821 29.5945 93.1823H8.48618C7.80067 93.1824 7.12499 93.0193 6.51504 92.7064C5.90509 92.3935 5.3784 91.9399 4.97855 91.3831C4.5787 90.8263 4.31718 90.1823 4.21562 89.5043C4.11406 88.8264 4.17538 88.134 4.39451 87.4844L30.6268 9.75838C30.9161 8.90078 31.4671 8.15554 32.2022 7.62762C32.9374 7.09971 33.8197 6.81572 34.7247 6.81567V6.81672Z" fill="url(#paint0_linear)" />
<path d="M74.14 62.7717H31.1295C30.7297 62.7713 30.339 62.8913 30.0083 63.1161C29.6776 63.3409 29.4222 63.6601 29.2755 64.032C29.1288 64.404 29.0976 64.8116 29.1858 65.2016C29.274 65.5916 29.4776 65.946 29.7702 66.2186L57.4077 92.0144C58.2123 92.765 59.2718 93.1824 60.3723 93.1821H84.7264L74.14 62.7717Z" fill="#0078D4" />
<path d="M34.727 6.81668C33.8121 6.81317 32.92 7.1023 32.181 7.64185C31.4421 8.18139 30.895 8.94308 30.6197 9.81564L4.4291 87.4136C4.19523 88.0655 4.1218 88.7641 4.21504 89.4504C4.30828 90.1367 4.56543 90.7904 4.96476 91.3563C5.36408 91.9221 5.89382 92.3835 6.50916 92.7014C7.12451 93.0192 7.80735 93.1842 8.49993 93.1823H30.1531C30.9595 93.0382 31.7133 92.6826 32.3373 92.1519C32.9614 91.6212 33.4334 90.9343 33.7051 90.1615L38.9281 74.7688L57.5843 92.1698C58.3661 92.8165 59.3468 93.174 60.3614 93.1823H84.6249L73.9833 62.7719L42.9614 62.7792L61.9479 6.81668H34.727Z" fill="url(#paint1_linear)" />
<path d="M69.3706 9.75415C69.0817 8.89794 68.5315 8.15393 67.7975 7.62694C67.0634 7.09995 66.1825 6.81655 65.2789 6.81665H35.0508C35.9544 6.8167 36.8352 7.10017 37.5692 7.62713C38.3032 8.1541 38.8535 8.89802 39.1424 9.75415L65.3758 87.4833C65.5951 88.133 65.6565 88.8255 65.5551 89.5037C65.4536 90.1818 65.1921 90.826 64.7923 91.383C64.3924 91.94 63.8657 92.3939 63.2557 92.7069C62.6456 93.02 61.9698 93.1833 61.2841 93.1833H91.5133C92.1989 93.1831 92.8746 93.0197 93.4845 92.7066C94.0944 92.3934 94.621 91.9396 95.0207 91.3826C95.4204 90.8256 95.6818 90.1814 95.7832 89.5034C95.8846 88.8253 95.8232 88.1329 95.6039 87.4833L69.3706 9.75415Z" fill="url(#paint2_linear)" />
<defs>
<linearGradient
id="paint0_linear"
x1="44.6101"
y1="13.2167"
x2="16.4424"
y2="96.4313"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="#114A8B" />
<stop offset="1" stop-color="#0669BC" />
</linearGradient>
<linearGradient
id="paint1_linear"
x1="53.4114"
y1="51.9969"
x2="46.8958"
y2="54.2"
gradientUnits="userSpaceOnUse"
>
<stop stop-opacity="0.3" />
<stop offset="0.071" stop-opacity="0.2" />
<stop offset="0.321" stop-opacity="0.1" />
<stop offset="0.623" stop-opacity="0.05" />
<stop offset="1" stop-opacity="0" />
</linearGradient>
<linearGradient
id="paint2_linear"
x1="49.8289"
y1="10.7896"
x2="80.7487"
y2="93.1656"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="#3CCBF4" />
<stop offset="1" stop-color="#2892DF" />
</linearGradient>
</defs>
</svg>
</template>

View File

@ -0,0 +1,7 @@
<template>
<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M76.1419 47.3651L74.2748 46.6184C65.4994 66.3636 30.5896 54.3595 28.489 60.2334C28.1389 64.2011 47.5532 60.9878 61.4326 61.6604C65.665 61.8653 67.7874 65.0603 65.9902 70.268L69.5301 70.2789C73.6135 57.5492 86.6452 64.0457 87.1898 59.8445C86.2951 57.0823 72.2129 59.8445 76.1419 47.3651Z" fill="white" />
<path d="M66.9917 68.0907C67.5518 66.2236 67.3651 64.3564 66.4317 63.236C65.4979 62.1156 64.1908 61.3688 62.5103 61.1822L30.0207 60.8084C29.834 60.8084 29.6473 60.6218 29.4607 60.6218C29.274 60.4351 29.274 60.2484 29.4607 60.0617C29.6473 59.6884 29.834 59.5013 30.2074 59.5013L62.8837 59.128C66.805 58.9413 70.913 55.767 72.4065 52.0327L74.274 47.178C74.274 46.991 74.4607 46.8043 74.274 46.6176C72.2198 37.0949 63.6308 29.9993 53.5476 29.9993C44.2115 29.9993 36.1825 35.9744 33.3816 44.3771C31.5145 43.07 29.274 42.3229 26.6598 42.51C22.1784 42.8833 18.6308 46.6176 18.0704 51.099C17.8837 52.2194 18.0704 53.3399 18.2574 54.4599C10.9752 54.6466 5 60.6218 5 68.0907C5 68.8374 5 69.3978 5.18668 70.1445C5.18668 70.5183 5.56004 70.7049 5.74707 70.7049H65.6846C66.058 70.7049 66.4317 70.5183 66.4317 70.1445L66.9917 68.0907Z" fill="#F4811F" />
<path d="M77.2603 47.1782H76.3265C76.1398 47.1782 75.9531 47.3649 75.7665 47.5516L74.4594 52.0329C73.8993 53.9001 74.086 55.7676 75.0197 56.8877C75.9531 58.0081 77.2603 58.7548 78.9407 58.9419L85.8496 59.3152C86.0363 59.3152 86.223 59.5019 86.4097 59.5019C86.5964 59.6886 86.5964 59.8753 86.4097 60.0619C86.223 60.4356 86.0363 60.6223 85.6626 60.6223L78.5674 60.9957C74.646 61.1824 70.5384 64.3566 69.0446 68.0909L68.6709 69.7717C68.4842 69.9584 68.6709 70.3318 69.0446 70.3318H93.6919C94.0653 70.3318 94.252 70.1451 94.252 69.7717C94.6253 68.2779 94.9987 66.5975 94.9987 64.9167C94.9987 55.2072 86.9697 47.1782 77.2603 47.1782Z" fill="#FAAD3F" />
</svg>
</template>

View File

@ -0,0 +1,31 @@
<template>
<svg width="0.73em" height="1em" viewBox="0 0 256 351"><defs><filter
id="IconifyId-17c6fdde69b-f33216-99"
x="-50%"
y="-50%"
width="200%"
height="200%"
filterunits="objectBoundingBox"
><feGaussianBlur stddeviation="17.5" in="SourceAlpha" result="shadowBlurInner1" /><feOffset in="shadowBlurInner1" result="shadowOffsetInner1" /><feComposite
in="shadowOffsetInner1"
in2="SourceAlpha"
operator="arithmetic"
k2="-1"
k3="1"
result="shadowInnerInner1"
/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0" in="shadowInnerInner1" /></filter><filter
id="IconifyId-17c6fdde69b-f33216-100"
x="-50%"
y="-50%"
width="200%"
height="200%"
filterunits="objectBoundingBox"
><feGaussianBlur stddeviation="3.5" in="SourceAlpha" result="shadowBlurInner1" /><feOffset dx="1" dy="-9" in="shadowBlurInner1" result="shadowOffsetInner1" /><feComposite
in="shadowOffsetInner1"
in2="SourceAlpha"
operator="arithmetic"
k2="-1"
k3="1"
result="shadowInnerInner1"
/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.09 0" in="shadowInnerInner1" /></filter><path id="IconifyId-17c6fdde69b-f33216-101" d="M1.253 280.732l1.605-3.131l99.353-188.518l-44.15-83.475C54.392-1.283 45.074.474 43.87 8.188L1.253 280.732z" /><path id="IconifyId-17c6fdde69b-f33216-102" d="M134.417 148.974l32.039-32.812l-32.039-61.007c-3.042-5.791-10.433-6.398-13.443-.59l-17.705 34.109l-.53 1.744l31.678 58.556z" /></defs><path d="M0 282.998l2.123-2.972L102.527 89.512l.212-2.017L58.48 4.358C54.77-2.606 44.33-.845 43.114 6.951L0 282.998z" fill="#FFC24A" /><use fill="#FFA712" fillRule="evenodd" xlink:href="#IconifyId-17c6fdde69b-f33216-101" /><use filter="url(#IconifyId-17c6fdde69b-f33216-99)" xlink:href="#IconifyId-17c6fdde69b-f33216-101" /><path d="M135.005 150.38l32.955-33.75l-32.965-62.93c-3.129-5.957-11.866-5.975-14.962 0L102.42 87.287v2.86l32.584 60.233z" fill="#F4BD62" /><use fill="#FFA50E" fillRule="evenodd" xlink:href="#IconifyId-17c6fdde69b-f33216-102" /><use filter="url(#IconifyId-17c6fdde69b-f33216-100)" xlink:href="#IconifyId-17c6fdde69b-f33216-102" /><path fill="#F6820C" d="M0 282.998l.962-.968l3.496-1.42l128.477-128l1.628-4.431l-32.05-61.074z" /><path d="M139.121 347.551l116.275-64.847l-33.204-204.495c-1.039-6.398-8.888-8.927-13.468-4.34L0 282.998l115.608 64.548a24.126 24.126 0 0 0 23.513.005" fill="#FDE068" /><path d="M254.354 282.16L221.402 79.218c-1.03-6.35-7.558-8.977-12.103-4.424L1.29 282.6l114.339 63.908a23.943 23.943 0 0 0 23.334.006l115.392-64.355z" fill="#FCCA3F" /><path d="M139.12 345.64a24.126 24.126 0 0 1-23.512-.005L.931 282.015l-.93.983l115.607 64.548a24.126 24.126 0 0 0 23.513.005l116.275-64.847l-.285-1.752l-115.99 64.689z" fill="#EEAB37" /></svg>
</template>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,12 @@
<template>
<svg
width="160"
height="160"
viewBox="0 0 160 160"
fill="none"
xmlns="http://www.w3.org/2000/svg"
class="text-black dark:text-white"
>
<path d="M80.0761 12L159.152 148.965H1L80.0761 12Z" fill="currentColor" />
</svg>
</template?

View File

@ -1,12 +1,20 @@
# Azure Functions
---
icon: LogoAzure
---
> How to deploy Nuxt to Azure Functions with Nuxt Nitro.
# Azure
- Support for serverless SSR build
- No configuration required
- Static assets served from Azure Function
Learn how to deploy Nuxt to Azure Static Web Apps or Azure Functions.
## Setup
## Azure Functions
::list
- Support for serverless SSR build
- No configuration required
- Static assets served from Azure Function
::
### Setup
```js [nuxt.config.js]
export default {
@ -16,7 +24,7 @@ export default {
}
```
## Local preview
### Local preview
Install [Azure Functions Core Tools](https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local) if you want to test locally.
@ -30,7 +38,7 @@ func start
You can now visit http://localhost:7071/ in your browser and browse your site running locally on Azure Functions.
## Deploy from your local machine
### Deploy from your local machine
To deploy, just run the following command:
```bash
@ -40,7 +48,7 @@ az functionapp deployment source config-zip -g <resource-group> -n <app-name> --
cd dist && func azure functionapp publish --javascript <app-name>
```
## Deploy from CI/CD via GitHub Actions
### Deploy from CI/CD via GitHub Actions
First, obtain your Azure Functions Publish Profile and add it as a secret to your GitHub repository settings following [these instructions](https://github.com/Azure/functions-action#using-publish-profile-as-deployment-credential-recommended).
@ -48,7 +56,6 @@ Then create the following file as a workflow:
```yml{}[.github/workflows/azure.yml]
name: azure
on:
push:
branches:
@ -56,16 +63,13 @@ on:
pull_request:
branches:
- main
jobs:
deploy:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
node: [ 12 ]
steps:
- uses: actions/setup-node@v2
with:
@ -103,10 +107,49 @@ jobs:
publish-profile: ${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }}
```
## Optimizing Azure Functions
### Optimizing Azure Functions
Consider [turning on immutable packages](https://docs.microsoft.com/en-us/azure/app-service/deploy-run-package) to support running your app from the zipfile. This can speed up cold starts.
## Demo
### Demo
A live demo is available on https://nuxt-nitro.azurewebsites.net/
## Azure Static Web Apps
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.
### 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.
Find the build configuration section in this 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.

View File

@ -1,10 +1,16 @@
---
icon: LogoCloudFlare
---
# Cloudflare Workers
> How to deploy Nuxt to Cloudflare Workers with Nuxt Nitro.
How to deploy Nuxt to Cloudflare Workers.
- Support for serverless SSR build
- Zero millisecond cold start with edge rendering
- Minimal configuration required
::list
- Support for serverless SSR build
- Zero millisecond cold start with edge rendering
- Minimal configuration required
::
## Setup

View File

@ -1,9 +1,16 @@
---
icon: LogoFirebase
---
# Firebase Hosting
> How to deploy Nuxt to Firebase Hosting with Nuxt Nitro
How to deploy Nuxt to Firebase Hosting.
::list
- Support for serverless build
- Minimal configuration required
::
- Support for serverless SSR build
- Minimal configuration required
## Setup

View File

@ -1,10 +1,16 @@
---
icon: LogoNetlify
---
# Netlify
> How to deploy Nuxt to Netlify with Nuxt Nitro
How to deploy Nuxt to [Netlify](https://www.netlify.com).
- Support for serverless SSR build
- Auto-detected when deploying
- No configuration required
::list
- Support for serverless SSR build
- Auto-detected when deploying
- No configuration required
::
## Setup

View File

@ -1,10 +1,16 @@
---
icon: LogoPM2
---
# PM2
> How to deploy Nuxt to a Node.js host with Nuxt Nitro
How to deploy Nuxt to a Node.js hosting.
::list
- Support for ultra-minimal SSR build
- Zero millisecond cold start
- More configuration required
::
## Setup

View File

@ -1,10 +1,16 @@
---
icon: LogoVercel
---
# Vercel
> How to deploy Nuxt to Vercel with Nuxt Nitro
Learn how to deploy a Nuxt application to [Vercel](https://vercel.com).
- Support for serverless SSR build
- Auto-detected when deploying
- No configuration required
::list
- Support for serverless build
- Auto-detected when deploying
- No configuration required
::
## Setup

View File

@ -1,4 +1,8 @@
# [Presets]
---
icon: IconPresets
---
# Presets
There are four provided generic presets for Nuxt Nitro that you can use out-of-the-box.

View File

@ -3,7 +3,7 @@ layout:
aside: true
asideClass: ''
navigation:
collapse: true
collapse: false
exclusive: false
redirect: /docs/deployment/platforms
redirect: /docs/deployment/azure
---

View File

@ -1,36 +0,0 @@
# Azure Static Web Apps
> How to deploy Nuxt to Azure Static Web Apps with Nuxt Nitro.
- 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.
## 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.
Find the build configuration section in this 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.