Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
mkdocs Azure DevOps pipeline
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
- master
vmImage: 'windows-latest'
- task: UsePythonVersion@0
versionSpec: '3.7'
addToPath: true
architecture: 'x64'
- script: python -m pip install --upgrade pip setuptools wheel
displayName: 'Install tools'
- script: pip install mkdocs-material
displayName: Install MkDocs Material Theme
- script: |
pip install mkdocs
mkdocs build
displayName: Install the MkDocs + build
- task: AzureFileCopy@4
SourcePath: 'site/*'
azureSubscription: 'Pay-As-You-Go(54cd7785-8bb1-4bf4-86f1-bd2edfce207e)'
Destination: 'AzureBlob'
storage: 'imkarlme'
ContainerName: '$web'
- task: PowerShell@2
targetType: 'inline'
script: |
#Embed with title, description, and color
#Store webhook url
$webHookUrl = ''
#Create embed array
[System.Collections.ArrayList]$embedArray = @()
#Store embed values
$title = ''
$description = 'Pipeline has completed successfully!'
$color = '445734'
#Create embed object
$embedObject = [PSCustomObject]@{
title = $title
description = $description
color = $color
#Add embed object to array
$embedArray.Add($embedObject) | Out-Null
#Create the payload
$payload = [PSCustomObject]@{
embeds = $embedArray
#Send over payload, converting it to JSON
Invoke-RestMethod -Uri $webHookUrl -Body ($payload | ConvertTo-Json -Depth 4) -Method Post -ContentType 'application/json'
displayName: Discord Notification
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment