Publish pricing.json to S3 bucket #3763
This file contains hidden or 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
| # Workflow which runs on daily basis and publishes pricing data to S3 bucket | |
| name: Publish pricing.json to S3 bucket | |
| on: | |
| schedule: | |
| - cron: '0 13 * * *' | |
| - cron: '0 2 * * *' | |
| permissions: | |
| contents: read # for actions/checkout to fetch code | |
| jobs: | |
| generate_and_publish_pricing_data: | |
| name: Generate and Publish Pricing file to S3 | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| strategy: | |
| matrix: | |
| python_version: [ "3.10" ] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Use Python ${{ matrix.python_version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python_version }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Print Environment Info | |
| run: printenv | sort | |
| - name: Install Python Dependencies | |
| run: | | |
| uv sync --group ci --no-dev | |
| echo "${GITHUB_WORKSPACE}/.venv/bin" >> "$GITHUB_PATH" | |
| - name: Generate and publish pricing data | |
| env: | |
| GCE_API_KEY: ${{ secrets.GCE_API_KEY }} | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_ACCESS_KEY_SECRET: ${{ secrets.AWS_ACCESS_KEY_SECRET }} | |
| run: script -e -c "tox -escrape-and-publish-provider-prices" | |
| - name: Verify files can be downloaded | |
| # Verify that the permissions are correct and files can be downloaded publicly | |
| run: | | |
| curl --fail https://libcloud-pricing-data.s3.amazonaws.com/pricing.json | |
| curl --fail https://libcloud-pricing-data.s3.amazonaws.com/pricing.json.sha256 | |
| curl --fail https://libcloud-pricing-data.s3.amazonaws.com/pricing.json.sha512 |