microsoft / azurechat

🤖 💼 Azure Chat Solution Accelerator powered by Azure Open AI Service
MIT License
1.15k stars 958 forks source link

Deploy via Azure DevOps #289

Closed sonphnt closed 5 months ago

sonphnt commented 5 months ago

Hi, Has anyone deployed successfully by using Azure DevOps pipeline with yml file?

Thanks a lot.

n3662 commented 5 months ago

@sonphnt

Here is the yml file for our devops Pipeline

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

resources:
  pipelines:
    - pipeline: Azure Chat GPT-CI # Name of the pipeline resource.
      source: Azure Chat GPT-CI # The name of the pipeline referenced by this pipeline resource.
      trigger: true

pool:
  vmImage: ubuntu-latest

steps:
  - task: NodeTool@0
    inputs:
      versionSpec: "18.x"
    displayName: "Install Node.js"

  - script: |
      cd ./src
      npm install
      npm run build
      cd ..
      cp -R ./src/.next/standalone ./site-deploy
      cp -R ./src/.next/static ./site-deploy/.next/static
      cp -R ./src/public ./site-deploy/public
      cd ./site-deploy
      zip Nextjs-site.zip ./* .next -qr
    displayName: "yarn install and build"

  - task: AzureRmWebAppDeployment@4
    inputs:
      ConnectionType: "AzureRM"
      azureSubscription: "azure-sub-connection"
      appType: "webAppLinux"
      WebAppName: "your-web-app"
      packageForLinux: "$(System.DefaultWorkingDirectory)/**/*.zip"
      RuntimeStack: "NODE|18-lts"
The-Denno commented 5 months ago

Hello :)

where is this yaml from? Where can I find the referenced "Azure Chat GPT-CI" Pipeline?

Thank you

sonphnt commented 5 months ago

@n3662 Thanks. This is what I was looking for.

sonphnt commented 5 months ago

@The-Denno You can add a new file "azure-pipelines.yml" with the body above and select it when setting up a pipeline in Azure Devops