Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions .github/workflows/update-batch-vms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ jobs:
name: Update Batch VMs db
runs-on: ubuntu-latest
environment: test
permissions:
contents: write
pull-requests: write

steps:
- name: Azure login
Expand All @@ -34,14 +37,19 @@ jobs:
run: dotnet restore

- name: Build
run: dotnet build

- name: Run GenerateBatchVmSkus
run: ./src/GenerateBatchVmSkus/bin/Debug/net7.0/GenerateBatchVmSkus --subscriptionId ${{ secrets.AZURE_SUBSCRIPTION_ID }} --outputFilePath src/TesApi.Web/BatchSupportedVmSizeInformation.json --TestedVmSkus src/TesApi.Web/DefaultVmPrices.json
run: dotnet build --no-restore

- name: Restore nuget.config
run: git restore nuget.config

- name: Retrieve configuration
run: echo "$APPSETTINGS" > src/GenerateBatchVmSkus/bin/Debug/net8.0/appsettings.json
env:
APPSETTINGS: ${{ secrets.AZURE_VM_TEST_CONFIG }}

- name: Run GenerateBatchVmSkus
run: ./src/GenerateBatchVmSkus/bin/Debug/net8.0/GenerateBatchVmSkus --outputFilePath src/TesApi.Web/BatchSupportedVmSizeInformation.json

- run: if (( $(git diff src/TesApi.Web/BatchSupportedVmSizeInformation.json | wc -l) > 0 )); then echo "UPDATE_PR=True" >> $GITHUB_ENV; fi

- name: Checkout branch, commit and push
Expand All @@ -58,8 +66,8 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

#- name: create pull request
# if: env.UPDATE_PR != null && env.SUBMIT_PR != null
# run: gh pr create --assignee jsaun -B develop -H update-batch-vms --title 'Update BatchSupportedVmSizeInformation.json' --body 'Update BatchSupportedVmSizeInformation.json'
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: create pull request
if: env.UPDATE_PR != null && env.SUBMIT_PR != null
run: gh pr create --assignee jsaun -B develop -H update-batch-vms --title 'Update BatchSupportedVmSizeInformation.json' --body 'Update BatchSupportedVmSizeInformation.json'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}