Skip to content

Commit

Permalink
Update GitHub Workflows to reflect changes
Browse files Browse the repository at this point in the history
Signed-off-by: Isaac Milarsky <[email protected]>
  • Loading branch information
IsaacMilarky committed May 6, 2024
1 parent ca127a2 commit a5492eb
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 2 deletions.
41 changes: 40 additions & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,47 @@ concurrency:
cancel-in-progress: false

jobs:
update-reports-and-graphs:
permissions: write-all
name: update reports and graphs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# update stats
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- run: pip install -r requirements.txt
- run: ./gen_reports.sh
env:
GITHUB_TOKEN: ${{ secrets.METRICS_GITHUB_TOKEN }}
AUGUR_HOST: ${{ vars.AUGUR_HOST }}
- run: ./gen_graphs.sh
env:
GITHUB_TOKEN: ${{ secrets.METRICS_GITHUB_TOKEN }}
AUGUR_HOST: ${{ vars.AUGUR_HOST }}
- run: |
git config user.name 'GitHub Actions'
git config user.email '[email protected]'
git add -A
timestamp=$(date -u)
git commit -m "update data: ${timestamp}" || exit 0
- name: Push to ${{ github.ref_name }}
uses: CasperWA/push-protected@v2
with:
token: ${{ secrets.METRICS_GITHUB_TOKEN }}
branch: ${{ github.ref_name }}
deploy:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs: update-reports-and-graphs
defaults:
run:
working-directory: ./app
Expand Down Expand Up @@ -55,4 +93,5 @@ jobs:
path: app/dist

- name: Deploy to GitHub pages
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v2

4 changes: 4 additions & 0 deletions gen_graphs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
pwd
cd scripts
python3 refresh_graphs.py
4 changes: 4 additions & 0 deletions gen_reports.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
pwd
cd scripts
python3 refresh_reports.py
1 change: 0 additions & 1 deletion scripts/refresh_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import json
from fetch_public_metrics import get_all_data, parse_repos_and_orgs_into_objects
from fetch_public_metrics import parse_tracked_repos_file, read_previous_metric_data
from gen_graphs import generate_all_graphs_for_repos, generate_all_graphs_for_orgs



Expand Down

0 comments on commit a5492eb

Please sign in to comment.