Skip to content

Commit

Permalink
Merge pull request #4823 from GSA/ga-metrics-actions-file
Browse files Browse the repository at this point in the history
commit metrics report action to master to test code
  • Loading branch information
btylerburton authored Jul 19, 2024
2 parents ccbb1a1 + d6d77d3 commit bc07841
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/build-metrics-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
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
env:
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID_METRICS}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY_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
run: |
poetry run python datagov_metrics

0 comments on commit bc07841

Please sign in to comment.