Generate Azure MD Pricing JSON #28
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: Generate Azure MD Pricing JSON | |
on: | |
schedule: | |
# ┌───────────── minute (0 - 59) | |
# │ ┌───────────── hour (0 - 23) | |
# │ │ ┌───────────── day of the month (1 - 31) | |
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) | |
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) | |
# │ │ │ │ │ | |
# │ │ │ │ │ | |
# │ │ │ │ │ | |
# * * * * * | |
# At 04:00 UTC on Sundays | |
- cron: "0 4 * * 0" | |
# Workflow dispatch trigger allows manually running workflow | |
workflow_dispatch: {} | |
jobs: | |
azure_md_pricing: | |
name: "Generate Azure MD Pricing" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Speed up checkout by not fetching history | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.10.12 | |
cache: 'pip' # caching pip dependencies | |
- run: pip install -r requirements.txt | |
- run: | | |
python3 tools/cloud_data/azure/azure_md_pricing.py | |
python3 tools/cloud_data/azure/azure_md_tier_types.py | |
- name: Create Pull Request | |
id: cpr | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
commit-message: "Update Azure MD Pricing Data" | |
title: "Update Azure MD Pricing Data" | |
body: "Updated Azure MD Pricing from GitHub Actions Workflow [${{ github.workflow }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})" | |
branch: "task/update-azure-md-pricing" | |
delete-branch: true | |
labels: "automation, data, azure" | |
- name: Check outputs | |
if: ${{ steps.cpr.outputs.pull-request-number }} | |
run: | | |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" | |
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" |