Skip to content

Commit

Permalink
Update docker.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
WeihanLi authored Jun 6, 2024
1 parent c176f02 commit 0871fdd
Showing 1 changed file with 3 additions and 23 deletions.
26 changes: 3 additions & 23 deletions .azure/pipelines/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,19 @@ variables:
- group: docker

steps:
- task: UseDotNet@2
displayName: 'Use .NET 6 sdk'
inputs:
packageType: sdk
version: 6.0.x
- task: UseDotNet@2
displayName: 'Use .NET 7 sdk'
inputs:
packageType: sdk
version: 7.0.x
- task: UseDotNet@2
displayName: 'Use .NET 8 sdk'
inputs:
packageType: sdk
version: 8.0.x
# includePreviewVersions: true # Required for preview versions

- script: dotnet restore
displayName: "dotnet restore"
- script: dotnet build -c Release
displayName: "dotnet build"

- script: docker build -f Dockerfile -t weihanli/dotnet-httpie:latest -t weihanli/dotnet-httpie:preview -t weihanli/dotnet-httpie:stable .
displayName: 'Docker build Script'

- script: |
docker login -u $(dockerId) -p $(pswd)
docker push weihanli/dotnet-httpie:latest
- script: |
docker push weihanli/dotnet-httpie:preview
displayName: 'Push preview image'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/preview'))

- script: |
docker login -u $(dockerId) -p $(pswd)
docker push weihanli/dotnet-httpie:stable
displayName: 'Push stable image'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))

0 comments on commit 0871fdd

Please sign in to comment.