diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5b36ec6..04946f7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -6,40 +6,34 @@ trigger: pr: none pool: - vmImage: 'windows-latest' - -variables: - pushChanges: 'No' + vmImage: "windows-latest" steps: -- task: PowerShell@2 - displayName: 'Update archives' - inputs: - targetType: 'filePath' - filePath: './update_archives.azure.ps1' - failOnStderr: true - workingDirectory: '.' -- task: PowerShell@2 - displayName: 'Commit changes' - condition: and(succeeded(), eq(variables.pushChanges, 'Yes')) - inputs: - targetType: 'inline' - script: '$ErrorActionPreference = "Stop"; - git config --local user.name "BotPatty"; - git config --local user.email "ci@zint.ch"; - git add ./files/GCMCodes.zip; - git add ./files/DolphinCodes.zip; - git commit -m "update archives [skip ci]";' - failOnStderr: true - workingDirectory: '.' -- task: PowerShell@2 - displayName: 'Push Changes' - condition: and(succeeded(), eq(variables.pushChanges, 'Yes')) - env: - GitHub_PAT: $(GitHub_PAT) - inputs: - targetType: 'inline' - script: '$ErrorActionPreference = "Stop"; - git push -q $(GitHub_PAT) HEAD:master;' - failOnStderr: true - workingDirectory: '.' + - task: PowerShell@2 + displayName: "Update archives" + inputs: + targetType: "filePath" + filePath: "./update_archives.azure.ps1" + failOnStderr: true + workingDirectory: $(Build.SourcesDirectory) + - task: NodeTool@0 + displayName: "Setup node 12.x" + inputs: + versionSpec: "12.x" + - task: PowerShell@2 + displayName: "Create Build" + inputs: + targetType: "filePath" + filePath: "./build.azure.ps1" + failOnStderr: true + workingDirectory: $(Build.SourcesDirectory) + - task: PowerShell@2 + displayName: "Push Changes" + condition: succeeded() + env: + GitHub_PAT: $(GitHub_PAT) + inputs: + targetType: "inline" + script: "git push -uqf $(GitHub_PAT) HEAD:gh-pages;" + failOnStderr: true + workingDirectory: $(Build.SourcesDirectory)/docs/.vuepress/dist diff --git a/build.azure.ps1 b/build.azure.ps1 new file mode 100644 index 0000000..22384e7 --- /dev/null +++ b/build.azure.ps1 @@ -0,0 +1,20 @@ +$ErrorActionPreference = "Stop"; + +Write-Host -ForegroundColor Blue "Ensuring yarn is installed.."; +npm i -g yarn; + +Write-Host -ForegroundColor Blue "Installing dependencies.."; +yarn; + +Write-Host -ForegroundColor Blue "Creating new build.."; +yarn build; + +Write-Host -ForegroundColor Blue "Initializing git repository"; +git config --local user.name "BotPatty"; +git config --local user.email "ci@zint.ch"; +$Remote = (git remote get-url origin); +Set-Location "./docs/.vuepress/dist"; +git init; +git remote add origin $Remote; +git add .; +git commit -m "auto-deployment"; \ No newline at end of file diff --git a/dna.js b/dna.js deleted file mode 100644 index c8d642f..0000000 --- a/dna.js +++ /dev/null @@ -1,16 +0,0 @@ -var _paq = window._paq || []; -_paq.push(["disableCookies"]), - _paq.push(["trackPageView"]), - _paq.push(["enableLinkTracking"]), - (function() { - var e = "//dna.zint.ch/"; - _paq.push(["setTrackerUrl", e + "pdna"]), _paq.push(["setSiteId", "2"]); - var a = document, - t = a.createElement("script"), - p = a.getElementsByTagName("script")[0]; - (t.type = "text/javascript"), - (t.async = !0), - (t.defer = !0), - (t.src = e + "jdna"), - p.parentNode.insertBefore(t, p); - })(); diff --git a/CNAME b/docs/.vuepress/public/CNAME similarity index 100% rename from CNAME rename to docs/.vuepress/public/CNAME diff --git a/update_archives.azure.ps1 b/update_archives.azure.ps1 index dc63bdd..2ab4dfc 100644 --- a/update_archives.azure.ps1 +++ b/update_archives.azure.ps1 @@ -93,7 +93,4 @@ Write-Host -ForegroundColor Green "Dolphin Archive rebuilt"; Write-Host "Cleaning up.."; Set-Location ..; Remove-Item "./.build" -Recurse; -Write-Host -ForegroundColor Green "Done"; - -# Set Azure variable to commit and push changes -Write-Host "##vso[task.setvariable variable=pushChanges;]Yes" \ No newline at end of file +Write-Host -ForegroundColor Green "Done"; \ No newline at end of file