Azure 开发人员使用 github 上的特定文件夹创建管道

标签 azure azure-devops

在 dev.azure.com 上创建管道时,如何选择 Github 上的特定文件夹。例如: https://github.com/username/projectname/tree/main/frontend .

我不想使用 https://github.com/username/projectname/tree/main ,但仅限 frontend 文件夹。

我在同一个 github 项目中获得了后端和前端,但我只需要为 Angular 前端创建一个管道即可创建静态网站。

我尝试了谷歌和所有方法,但找不到答案。

# Node.js with Angular
# Build a Node.js project that uses Angular.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://learn.microsoft.com/azure/devops/pipelines/languages/javascript

trigger:
- main

pool:
  vmImage: ubuntu-latest

steps:
- task: NodeTool@0
  inputs:
    versionSpec: '10.x'
  displayName: 'Install Node.js'

- script: |
    npm install -g @angular/cli
    npm install
    ng build --prod
  displayName: 'npm install and build'

最佳答案

- script: |
    cd ./frontend
    npm install -g @angular/cli
    npm install
    ng build --prod
  displayName: 'npm install and build'

关于Azure 开发人员使用 github 上的特定文件夹创建管道,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67838899/

相关文章:

powershell - Azure DevOps 因警告而失败,且 'fail on standard error' 设置为 true

azure - 如何确定Azure网站的传出IP地址?

azure - 在 azure devops 门户上查看代码覆盖率报告

c# - Azure - 从辅助角色访问与 Web 角色中相同的 blob

Azure - 在 Java Spring Boot 中使用用户管理身份访问 Key Vault : Error Details: ManagedIdentityCredential authentication unavailable?

.net-core - Nuget 还原不适用于 Azure Devops 中的工件源

azure-devops - 如何在没有 YAML 的代理池下使用特定的私有(private)代理?

Azure PowerShell 任务找不到文件路径

c# - Asp net core在azure应用程序服务上发布500服务器错误

python - Azure 日志分析 : How to send custom python pandas DataFrames into LAW