Skip to content

Instantly share code, notes, and snippets.

@davidobrien1985
Created February 16, 2020 05:46
Show Gist options
  • Save davidobrien1985/c93dec5629d5dc2d83697288b1b6a3ef to your computer and use it in GitHub Desktop.
Save davidobrien1985/c93dec5629d5dc2d83697288b1b6a3ef to your computer and use it in GitHub Desktop.
azure devops pipeline example build - release
trigger:
branches:
include:
- master
paths:
exclude:
- infra/*
include:
- xirus/*
stages:
- stage: Build_site
jobs:
- job:
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UseRubyVersion@0
inputs:
versionSpec: '>= 2.5'
- script: |
gem install jekyll bundler
displayName: 'bundle install'
- script: |
bundle update listen
bundle install
bundle exec jekyll build
displayName: 'jekyll build'
workingDirectory: xirus
- task: CopyFiles@2
displayName: 'Copy Files to: $(Build.ArtifactStagingDirectory)'
inputs:
SourceFolder: 'xirus/_site'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: site
- stage: Deploy_site
jobs:
- deployment: prod
environment: prod
pool:
vmImage: 'ubuntu-latest'
variables:
- name: accountName
value: storagedeaccountname
strategy:
runOnce:
deploy:
steps:
- task: AzureCLI@2
displayName: Copy website files to Azure Storage
inputs:
azureSubscription: prod
scriptType: bash
scriptLocation: inlineScript
inlineScript: |
az storage blob upload-batch -d '$web' -s $(Pipeline.Workspace)/site --account-name $(accountName) --output table --no-progress
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment