wwt-user-website/azure-pipelines.yml

52 строки
1.5 KiB
YAML
Исходник Постоянная ссылка Обычный вид История

# Custom pipeline here because unlike the other static sites, we can't run the
# build on Windows because we need to use a case-sensitive filesystem. That
# means that we can't use the AzureFileCopy command to upload the files to
# Azure Storage.
2020-04-26 01:54:40 +03:00
parameters:
- name: 'zolaVersion'
default: '0.15.2'
type: string
2020-04-26 01:54:40 +03:00
jobs:
- job: BuildAndPublish
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
submodules: recursive
- script: |
u='https://github.com/getzola/zola/releases/download/v${{ parameters.zolaVersion }}/zola-v${{ parameters.zolaVersion }}-x86_64-unknown-linux-gnu.tar.gz'
curl -fsSL "$u" |tar xz
displayName: Install Zola
# The check fails spuriously on Azure Pipelines too often to be useful.
# - script: |
# ./zola check
# displayName: Check site
- script: |
# The "echo" gets past a Zola confirmation to blow away the output directory
echo y |./zola build -o $(build.artifactStagingDirectory)
displayName: Build site
- task: PublishPipelineArtifact@0
displayName: Publish site as artifact
inputs:
artifactName: static-site
targetPath: $(Build.ArtifactStagingDirectory)
- task: AzureCLI@2
displayName: Upload to Azure Storage
inputs:
azureSubscription: 'aas@wwtadmindotnetfoundation'
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
az storage blob upload-batch --overwrite -s $(build.artifactStagingDirectory) -d '$web'
env:
AZURE_STORAGE_CONNECTION_STRING: $(AZURE_STORAGE_CONNECTION_STRING)