Build Metrics Report #5
Workflow file for this run
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: Build Metrics Report | |
on: # yamllint disable-line rule:truthy | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * *" # every day at 12am UTC | |
env: | |
PY_VERSION: "3.10" | |
POETRY_VERSION: "1.7.1" | |
jobs: | |
fetch-report: | |
defaults: | |
run: | |
working-directory: metrics | |
runs-on: ubuntu-latest | |
name: Fetch Reports | |
steps: | |
- name: Check out the code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Set up Python ${{ env.PY_VERSION }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PY_VERSION }} | |
- name: Install Poetry | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: ${{ env.POETRY_VERSION }} | |
- name: Install Dependencies | |
run: | | |
poetry env use ${{ env.PY_VERSION }} | |
poetry install | |
- name: Retrieve the credentials and decode to a file | |
env: | |
GA_CREDENTIALS_JSON: ${{ secrets.GA_CREDENTIALS_JSON }} | |
run: | | |
echo $GA_CREDENTIALS_JSON | base64 --decode > datagov_metrics/credentials.json | |
- name: Run Python script | |
env: | |
AWS_ACCESS_KEY_ID_METRICS: ${{ secrets.AWS_ACCESS_KEY_ID_METRICS }} | |
AWS_SECRET_ACCESS_KEY_METRICS: ${{ secrets.AWS_SECRET_ACCESS_KEY_METRICS }} | |
run: | | |
poetry run python datagov_metrics |