Skip to content

Instantly share code, notes, and snippets.

@craigiswayne
Last active May 21, 2023 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save craigiswayne/e66421af4275ee947cd18ed726219d97 to your computer and use it in GitHub Desktop.
Save craigiswayne/e66421af4275ee947cd18ed726219d97 to your computer and use it in GitHub Desktop.
Azure Pipeline to Deploy Angular as a Static Web App
trigger:
batch: true
branches:
include:
- '*'
pr:
branches:
include:
- '*'
variables:
# defined in the Pipeline Library variable group
# see: https://learn.microsoft.com/en-us/azure/devops/pipelines/library/variable-groups?view=azure-devops&tabs=yaml
- group: DEFAULT_VARIABLE_GROUP
pool:
vmImage: ubuntu-latest
steps:
- task: NodeTool@0
displayName: 'Install Node.js'
inputs:
versionSpec: '14.21.3'
- task: Npm@1
inputs:
command: 'ci'
- script: npm run build
- task: AzureStaticWebApp@0
inputs:
app_location: 'dist/playground-angular'
# location of staticwebapp.config.json
config_file_location: '/'
skip_app_build: true
skip_api_build: true
is_static_export: true
azure_static_web_apps_api_token: '$(AZURE_STATIC_WEB_APPS_API_TOKEN)'
{
"navigationFallback": {
"rewrite": "/index.html",
"exclude": ["/images/*.{png,jpg,gif}", "/css/*", "/sitemap.xml", "/robots.txt"]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment