您可以在 Azure Devops 中执行此操作。尝试将此 YML 放入 Azure DevOps Pipeline
trigger:
- main
pool:
vmImage: 'ubuntu-latest'
name: 'yourApplicationName'
steps:
- task: NodeTool@0
inputs:
versionSpec: '12.x'
displayName: 'Install Node.js'
- script: |
npm install -g @angular/cli
npm install
displayName: 'npm install'
workingDirectory: '$(Build.SourcesDirectory)/yourApplicationName'
- task: AzureStaticWebApp@0
inputs:
app_location: "/yourApplicationName"
api_location: "api"
app_build_command: $(build_command)
output_location: "dist/yourApplicationName"
env:
azure_static_web_apps_api_token: $(deployment_token)
您可以将 build_command 和 deployment_token 放在变量中