Azure / static-web-apps

Azure Static Web Apps. For bugs and feature requests, please create an issue in this repo. For community discussions, latest updates, kindly refer to the Discussions Tab. To know what's new in Static Web Apps, visit https://aka.ms/swa/ThisMonth
https://aka.ms/swa
MIT License
333 stars 57 forks source link

swa cli task in azuredevops server to publish apps into webapp #1192

Open vivuu1989 opened 1 year ago

vivuu1989 commented 1 year ago

We are trying to use Azure Static Webapp to deploy the Angular apps instead of currently used Azure App Service and looking for the ADO server task to replace the below app service deployment tasks in Azure Devops server.

- bash: |
       echo "Running npm lint:"
       npm run lint$subProject
       echo "Running npm build:"
       npm run build$subProject
       echo "Running npm test:"
       npm run test$subProject 

- task: AzureRmWebAppDeployment@4
  inputs:
    azureSubscription: '$(Subscription)'
    appType: webAppLinux
    WebAppName: '$(appService)'
    deployToSlotOrASE: true
    ResourceGroupName: '$(ResourceGroup)'
    SlotName: '$(SlotName)'
    packageForLinux: '$(Agent.ReleaseDirectory)/my-artifact/$(Build.BuildNumber).zip'
RuntimeStack: NODE|16-lts
StartupCommand: 'pm2 start /home/site/wwwroot/xxxxxx.config.js --no-daemon'

Since "Static Webapp Deployment" task is not supported in Azure Devops server, we have installed SWA CLI in our build agents.

So how can we directly deploy the build pipeline artifacts (.zip) files to static webapp using SWA cli in Azure Devops?

In release pipeline how can we replace the deployment command with swa cli ?

vivekjilla commented 1 year ago

@vivuu1989 Can you please check if you can use this task AzureStaticWebApp@0?

And to use SWA CLI in your pipeline, can you please try this doc and see if it helps: https://www.azurestaticwebapps.dev/blog/devtools-swacli-deploy#deploying-from-a-cicd-pipeline

vivuu1989 commented 1 year ago

The azurestatic webapp task is not supported in azuredevops server and we couldn't find this task in market place.