wwt-user-website/azure-pipelines.yml

50 строки
1.4 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.10.1'
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
- script: |
./zola check
displayName: Check site
- script: |
./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 -s $(build.artifactStagingDirectory) -d '$web'
env:
AZURE_STORAGE_CONNECTION_STRING: $(AZURE_STORAGE_CONNECTION_STRING)