Azure 静态 Web 应用任务
Azure DevOps Services
使用此任务生成和部署 Azure 静态 Web 应用。
YAML 代码片段
- task: AzureStaticWebApp@0
inputs:
app_location: # (Optional) File path. Directory location of the application source code relative to working directory
app_build_command: # (Optional) String. Custom command for Oryx to run when building application source code.
output_location: # (Optional) String. Directory location of the compiled application code after building.
api_location: # (Optional) String. Directory location of the Azure Functions source code relative to working directory.
api_build_command: # (Optional) Custom command for Oryx to run when building Azure Functions source code.
routes_location: # (Optional) Directory location where the routes.json file can be found, relative to working directory. Use staticwebapp.config.json.
config_file_location: # (Optional) Directory location where the staticwebapp.config.json file can be found, relative to working directory.
skip_app_build: # (Optional) Skips Oryx build for app folder.
verbose: # (Optional) Enables verbose logging.
build_timeout_in_minutes: # (Optional) Time limit of Oryx app folder build in minutes.
azure_static_web_apps_api_token: # (Optional) Api token for deployment. Not required if passed as an environment variable.
参数
| 参数 | 说明 |
|---|---|
app_location应用位置 |
(可选) 文件路径。 应用程序源代码相对于工作目录的目录位置 |
app_build_command应用生成命令 |
(可选) 字符串。 生成应用程序源代码时要运行的 Oryx 的自定义命令。 |
output_location输出位置 |
(可选) 字符串。 生成后编译的应用程序代码的目录位置。 |
api_locationAPI 位置 |
(可选) 字符串。 相对于工作目录Azure Functions源代码的目录位置。 |
api_build_commandAPI 生成命令 |
(可选) 字符串。 生成Azure Functions源代码时要运行的 Oryx 的自定义命令。 |
routes_location路由位置 |
(可选) 字符串。 相对于工作目录,可以找到 route.json 文件的目录位置。 请使用 staticwebapp.config.json。 |
config_file_location配置文件位置 |
(可选) 字符串。 相对于工作目录,可以找到该文件的 staticwebapp.config.json 目录位置。 |
skip_app_build跳过应用生成 |
(可选) 布尔值。 跳过应用文件夹的 Oryx 生成。 |
azure_static_web_apps_api_token(可选) Azure Static Web Apps API 令牌 |
(用于部署的可选) API 令牌。 如果作为环境变量传递,则不需要。 |
下面是用于生成和发布静态 Web 应用的示例 YAML 代码片段。
示例
trigger:
- main
pool:
vmImage: ubuntu-latest
steps:
- checkout: self
submodules: true
- task: AzureStaticWebApp@0
inputs:
app_location: '/src'
api_location: 'api'
output_location: '/src'
azure_static_web_apps_api_token: $(deployment_token)
开放源
此任务在 GitHub 上开放源代码。 欢迎提供反馈和建议。