Skip to content

Commit

Permalink
add update openapi inside apim
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaconsalvi committed Aug 22, 2024
1 parent 7b3de9d commit 4b0d024
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/post-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,33 @@ jobs:
if: steps.semantic.outputs.new_release_published == 'true'
run: echo "image_sha256=$(docker image inspect -f '{{index .RepoDigests 0}}' ghcr.io/${{ github.repository }}:${{ steps.semantic.outputs.new_release_version }})" >> "$GITHUB_ENV"

#
# Login to Azure.
#
- name: Login to Azure
uses: azure/login@8c334a195cbb38e46038007b304988d888bf676a #v2.0.0
with:
client-id: ${{ secrets.AZURE_CD_IDENTITY_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_CD_IDENTITY_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

#
# RELEASE CANDIDATE - Update Container App + OpenAPI descriptor on APIM
#
- name: RELEASE CANDIDATE - Update Container App + OpenAPI descriptor on APIM
if: steps.semantic.outputs.new_release_published == 'true'
uses: azure/CLI@fa0f960f00db49b95fdb54328a767aee31e80105
with:
inlineScript: |
API_DATA=$(az apim api show --resource-group ${{ secrets.AZURE_APIM_RESOURCE_GROUP }} --service-name ${{ secrets.AZURE_APIM_NAME }} --api-id ${{ secrets.AZURE_APIM_API_ID }} --subscription ${{ secrets.AZURE_SUBSCRIPTION_ID }} --query "{path:path, serviceUrl:serviceUrl}")
API_PATH=$(echo $API_DATA | jq -r '.path')
API_SERVICE_URL=$(echo $API_DATA | jq -r '.serviceUrl')
az apim api import \
--resource-group ${{ secrets.AZURE_APIM_RESOURCE_GROUP }} \
--service-name ${{ secrets.AZURE_APIM_NAME }} \
--api-id ${{ secrets.AZURE_APIM_API_ID }} \
--specification-format OpenApi \
--specification-path src/main/resources/META-INF/openapi.yaml \
--path $API_PATH \
--service-url $API_SERVICE_URL \
--subscription ${{ secrets.AZURE_SUBSCRIPTION_ID }}

0 comments on commit 4b0d024

Please sign in to comment.