在 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/