Skip to content

Instantly share code, notes, and snippets.

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

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)
- repo: self
- master
- script: ./
displayName: Clean Up
- script: docker login -u $(gpr_user) -p $(gpr_pat)
displayName: Logging into GitHub Package Registry
- script: docker build -t$(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)\"}"$(Build.Repository.ID)/git/refs
displayName: Create tag
- script: docker push$(Build.Repository.ID)/octocat-generator:$(Build.BuildNumber)
displayName: Pushing Docker image to GitHub Package Repository
- task: Docker@0
displayName: Run Jekyll
action: 'Run an image'
imageName: 'jekyll/minimal:3.8.5'
volumes: |
containerCommand: 'jekyll build --future'
detached: false
- task: ArchiveFiles@1
displayName: Archive Files
includeRootFolder: false
- task: PublishBuildArtifacts@1
displayName: Publish Site
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.