Skip to content

Instantly share code, notes, and snippets.

@rithala
Created May 19, 2020 14:09
Show Gist options
  • Save rithala/749efe0710024faa18304abc82d2dce2 to your computer and use it in GitHub Desktop.
Save rithala/749efe0710024faa18304abc82d2dce2 to your computer and use it in GitHub Desktop.
Gatsby Azure DevOps pipeline
trigger:
branches:
include:
- master
- develop
paths:
include:
- src/SPA/*
exclude:
- src/SPA/README.md
variables:
workingDir: 'src/SPA/'
subcription: '<guid>'
accountName: 'accountname'
pool:
vmImage: ubuntu-latest
steps:
- task: Npm@1
displayName: CI
inputs:
command: 'ci'
workingDir: '$(workingDir)'
- task: Npm@1
displayName: Build
inputs:
command: 'custom'
workingDir: '$(workingDir)'
customCommand: 'run build'
env:
API_URL: /api
- task: PublishBuildArtifacts@1
displayName: Publish drop
inputs:
PathtoPublish: '$(workingDir)/public'
ArtifactName: 'drop'
publishLocation: 'Container'
- task: AzureCLI@2
inputs:
azureSubscription: '$(subcription)'
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: 'az storage blob upload-batch -s $(workingDir)/public -d \$web --account-name $(accountName)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment