Skip to content

Instantly share code, notes, and snippets.

@jonico jonico/azure-pipelines.yml
Last active Nov 28, 2019

Embed
What would you like to do?
Build and push a docker image into GitHub Package registry and create a tag in GitHub using Azure Pipelines (AZP) yaml files (azure-pipelines.yaml)
resources:
- repo: self
trigger:
- master
steps:
- script: ./cleanup.sh
displayName: Clean Up
- script: docker login -u $(gpr_user) -p $(gpr_pat) docker.pkg.github.com
displayName: Logging into GitHub Package Registry
- script: docker build -t docker.pkg.github.com/$(Build.Repository.ID)/octocat-generator:$(Build.BuildNumber) .
displayName: Building Docker image
- script: |-
curl -s -H "Authorization: Token $(gpr_pat)" -H "Accept: application/json" -H "Content-type: application/json" -X POST -d "{ \"ref\": \"refs/tags/$(Build.BuildNumber)\", \"sha\": \"$(Build.SourceVersion)\"}" https://api.github.com/repos/$(Build.Repository.ID)/git/refs
displayName: Create tag
- script: docker push docker.pkg.github.com/$(Build.Repository.ID)/octocat-generator:$(Build.BuildNumber)
displayName: Pushing Docker image to GitHub Package Repository
- task: Docker@0
displayName: Run Jekyll
inputs:
action: 'Run an image'
imageName: 'jekyll/minimal:3.8.5'
volumes: |
$(Build.SourcesDirectory):/srv/jekyll
$(Build.BinariesDirectory):/srv/jekyll/_site
containerCommand: 'jekyll build --future'
detached: false
- task: ArchiveFiles@1
displayName: Archive Files
inputs:
includeRootFolder: false
- task: PublishBuildArtifacts@1
displayName: Publish Site
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
ArtifactName: www
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.