teamsapp.yml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. # yaml-language-server: $schema=https://aka.ms/teams-toolkit/1.0.0/yaml.schema.json
  2. # Visit https://aka.ms/teamsfx-v5.0-guide for details on this file
  3. # Visit https://aka.ms/teamsfx-actions for details on actions
  4. version: 1.0.0
  5. environmentFolderPath: ./env
  6. # Triggered when 'teamsapp provision' is executed
  7. provision:
  8. # Creates a Teams app
  9. - uses: teamsApp/create
  10. with:
  11. # Teams app name
  12. name: share${{APP_NAME_SUFFIX}}
  13. # Write the information of created resources into environment file for
  14. # the specified environment variable(s).
  15. writeToEnvironmentFile:
  16. teamsAppId: TEAMS_APP_ID
  17. - uses: arm/deploy # Deploy given ARM templates parallelly.
  18. with:
  19. # AZURE_SUBSCRIPTION_ID is a built-in environment variable,
  20. # if its value is empty, TeamsFx will prompt you to select a subscription.
  21. # Referencing other environment variables with empty values
  22. # will skip the subscription selection prompt.
  23. subscriptionId: ${{AZURE_SUBSCRIPTION_ID}}
  24. # AZURE_RESOURCE_GROUP_NAME is a built-in environment variable,
  25. # if its value is empty, TeamsFx will prompt you to select or create one
  26. # resource group.
  27. # Referencing other environment variables with empty values
  28. # will skip the resource group selection prompt.
  29. resourceGroupName: ${{AZURE_RESOURCE_GROUP_NAME}}
  30. templates:
  31. - path: ./infra/azure.bicep # Relative path to this file
  32. # Relative path to this yaml file.
  33. # Placeholders will be replaced with corresponding environment
  34. # variable before ARM deployment.
  35. parameters: ./infra/azure.parameters.json
  36. # Required when deploying ARM template
  37. deploymentName: Create-resources-for-tab
  38. # Teams Toolkit will download this bicep CLI version from github for you,
  39. # will use bicep CLI in PATH if you remove this config.
  40. bicepCliVersion: v0.9.1
  41. # Validate using manifest schema
  42. - uses: teamsApp/validateManifest
  43. with:
  44. # Path to manifest template
  45. manifestPath: ./appPackage/manifest.json
  46. # Build Teams app package with latest env value
  47. - uses: teamsApp/zipAppPackage
  48. with:
  49. # Path to manifest template
  50. manifestPath: ./appPackage/manifest.json
  51. outputZipPath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip
  52. outputJsonPath: ./appPackage/build/manifest.${{TEAMSFX_ENV}}.json
  53. # Validate app package using validation rules
  54. - uses: teamsApp/validateAppPackage
  55. with:
  56. # Relative path to this file. This is the path for built zip file.
  57. appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip
  58. # Apply the Teams app manifest to an existing Teams app in
  59. # Teams Developer Portal.
  60. # Will use the app id in manifest file to determine which Teams app to update.
  61. - uses: teamsApp/update
  62. with:
  63. # Relative path to this file. This is the path for built zip file.
  64. appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip
  65. # Extend your Teams app to Outlook and the Microsoft 365 app
  66. - uses: teamsApp/extendToM365
  67. with:
  68. # Relative path to the build app package.
  69. appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip
  70. # Write the information of created resources into environment file for
  71. # the specified environment variable(s).
  72. writeToEnvironmentFile:
  73. titleId: M365_TITLE_ID
  74. appId: M365_APP_ID
  75. # Triggered when 'teamsapp deploy' is executed
  76. deploy:
  77. # Run npm command
  78. - uses: cli/runNpmCommand
  79. name: install dependencies
  80. with:
  81. args: install --production
  82. # Deploy your application to Azure App Service using the zip deploy feature.
  83. # For additional details, refer to https://aka.ms/zip-deploy-to-app-services.
  84. - uses: azureAppService/zipDeploy
  85. with:
  86. # Deploy base folder
  87. artifactFolder: .
  88. # Ignore file location, leave blank will ignore nothing
  89. ignoreFile: .webappignore
  90. # The resource id of the cloud resource to be deployed to.
  91. # This key will be generated by arm/deploy action automatically.
  92. # You can replace it with your existing Azure Resource id
  93. # or add it to your environment variable file.
  94. resourceId: ${{TAB_AZURE_APP_SERVICE_RESOURCE_ID}}
  95. # Triggered when 'teamsapp publish' is executed
  96. publish:
  97. # Validate using manifest schema
  98. - uses: teamsApp/validateManifest
  99. with:
  100. # Path to manifest template
  101. manifestPath: ./appPackage/manifest.json
  102. # Build Teams app package with latest env value
  103. - uses: teamsApp/zipAppPackage
  104. with:
  105. # Path to manifest template
  106. manifestPath: ./appPackage/manifest.json
  107. outputZipPath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip
  108. outputJsonPath: ./appPackage/build/manifest.${{TEAMSFX_ENV}}.json
  109. # Validate app package using validation rules
  110. - uses: teamsApp/validateAppPackage
  111. with:
  112. # Relative path to this file. This is the path for built zip file.
  113. appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip
  114. # Apply the Teams app manifest to an existing Teams app in
  115. # Teams Developer Portal.
  116. # Will use the app id in manifest file to determine which Teams app to update.
  117. - uses: teamsApp/update
  118. with:
  119. # Relative path to this file. This is the path for built zip file.
  120. appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip
  121. # Publish the app to
  122. # Teams Admin Center (https://admin.teams.microsoft.com/policies/manage-apps)
  123. # for review and approval
  124. - uses: teamsApp/publishAppPackage
  125. with:
  126. appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip
  127. # Write the information of created resources into environment file for
  128. # the specified environment variable(s).
  129. writeToEnvironmentFile:
  130. publishedAppId: TEAMS_APP_PUBLISHED_APP_ID
  131. projectId: 0489f4a2-d1d9-447d-b0ad-2b1f854410b6