Merge pull request #1927 from microsoft/dependabot/nuget/Microsoft.OD… #282
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Docker image | |
on: | |
workflow_dispatch: | |
push: | |
branches: [master, vnext] | |
paths: ['src/Microsoft.OpenApi.Hidi/**', '.github/workflows/**'] | |
env: | |
REGISTRY: msgraphprod.azurecr.io | |
IMAGE_NAME: public/openapi/hidi | |
jobs: | |
push_to_registry: | |
environment: | |
name: acr | |
name: Push Docker image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Login to GitHub package feed | |
uses: docker/[email protected] | |
with: | |
username: ${{ secrets.ACR_USERNAME }} | |
password: ${{ secrets.ACR_PASSWORD }} | |
registry: ${{ env.REGISTRY }} | |
- run: | | |
$content = [XML](Get-Content ./src/Microsoft.OpenApi.Hidi/Microsoft.OpenApi.Hidi.csproj) | |
$version = $content.Project.PropertyGroup.Version | |
echo "::set-output name=version::${version}" | |
shell: pwsh | |
id: getversion | |
- name: Push to GitHub Packages - Nightly | |
if: ${{ github.ref == 'refs/heads/vnext' }} | |
uses: docker/[email protected] | |
with: | |
push: true | |
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:nightly | |
- name: Push to GitHub Packages - Release | |
if: ${{ github.ref == 'refs/heads/master' }} | |
uses: docker/[email protected] | |
with: | |
push: true | |
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.getversion.outputs.version }} |