Created
April 6, 2023 20:14
-
-
Save dombarnes/2253f95ff9184a6bac881484c734d625 to your computer and use it in GitHub Desktop.
Azure DevOps Pipeline for deploying NuxtJS 3 to Azure Static Web Apps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Node.js with Vue | |
# Build a Node.js project that uses Vue. | |
# Add steps that analyze code, save build artifacts, deploy, and more: | |
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript | |
trigger: | |
- main | |
variables: | |
isMain: $[eq(variables['Build.SourceBranch'], 'refs/heads/main')] | |
pool: | |
vmImage: 'ubuntu-latest' | |
stages: | |
- stage: BuildProductionAssets | |
displayName: 'Build production distritbution assets' | |
jobs: | |
- job: LintCheck | |
steps: | |
- task: NodeTool@0 | |
inputs: | |
versionSpec: '18.x' | |
displayName: 'Install Node.js' | |
- script: yarn install | |
displayName: 'yarn' | |
- script: yarn lint | |
displayName: 'yarn lint' | |
- deployment: StagingDeployment | |
displayName: 'Deployment to staging slot on Azure Static Web Apps' | |
environment: 'production' | |
condition: eq(variables.isMain, 'true') | |
strategy: | |
runOnce: | |
deploy: | |
steps: | |
- checkout: self | |
- task: AzureStaticWebApp@0 | |
inputs: | |
# workingDirectory: '$(System.DefaultWorkingDirectory)' # string. Alias: cwd | rootDirectory. Working directory. Default: $(System.DefaultWorkingDirectory). | |
app_location: '/' # string. App location. | |
app_build_command: 'NITRO_PRESET=azure yarn build' # string. App build command. | |
output_location: '.output/public' # string. Output location. | |
api_build_command: 'NITRO_PRESET=azure-functions yarn build' # string. Api build command. | |
api_location: '.output/server' # string. Api location. | |
# routes_location: # string. Routes location. | |
# config_file_location: # string. Config file location. | |
# skip_app_build: # boolean. Skip app build. | |
skip_api_build: true # boolean. Skip api build. | |
# is_static_export: # boolean. Set static export. | |
verbose: true # boolean. Verbose. | |
# build_timeout_in_minutes: # string. Build timeout in minutes. | |
azure_static_web_apps_api_token: $(deployment_token) # string. Azure Static Web Apps api token. | |
# deployment_environment: # string. Deployment Environment. | |
# production_branch: # string. Production Branch. | |
- publish: $(System.DefaultWorkingDirectory)/.output | |
artifact: WebApp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment