-
Notifications
You must be signed in to change notification settings - Fork 925
54 lines (44 loc) · 1.6 KB
/
publish_pricing_to_s3.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# 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.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@v5
with:
python-version: ${{ matrix.python_version }}
- name: Install Python Dependencies
run: |
pip install -r requirements-ci.txt
- 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