Publish pricing.json to S3 bucket #129
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
# 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 | |
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.8] | |
steps: | |
- name: Print Environment Info | |
id: printenv | |
run: | | |
printenv | sort | |
- uses: actions/checkout@master | |
with: | |
fetch-depth: 1 | |
- name: Use Python ${{ matrix.python_version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python_version }} | |
- name: Install Python Dependencies | |
run: | | |
pip install "tox==4.4.2" | |
- 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 |