-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4823 from GSA/ga-metrics-actions-file
commit metrics report action to master to test code
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
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
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 |