|
| 1 | +name: Fetch Data |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + # Normal schedule |
| 6 | + # # at 01:15 on all days in first month of each quarter |
| 7 | + # - cron: '15 1 * 1,4,7,10 *' |
| 8 | + # # at 01:15 on days 1-14 in second month of each quarter |
| 9 | + # - cron: '15 1 1-14 2,5,8,11 *' |
| 10 | + # Temp schedule |
| 11 | + # at 01:15 on all days in all months |
| 12 | + - cron: '15 1 * * *' |
| 13 | + |
| 14 | + workflow_dispatch: |
| 15 | + |
| 16 | +jobs: |
| 17 | + fetch: |
| 18 | + runs-on: ubuntu-latest |
| 19 | + |
| 20 | + steps: |
| 21 | + |
| 22 | + # CC Technology team members: |
| 23 | + # See cc-quantifying-bot GitHub entry in Bitwarden for information on |
| 24 | + # BOT_ secrets |
| 25 | + - name: Configure git |
| 26 | + run: | |
| 27 | + git config --global init.defaultBranch main |
| 28 | + git config --global user.name "${{ secrets.BOT_NAME }}" |
| 29 | + git config --global user.email "${{ secrets.BOT_EMAIL }}" |
| 30 | +
|
| 31 | + - name: Checkout repository |
| 32 | + uses: actions/checkout@v4 |
| 33 | + with: |
| 34 | + # Default fetch-depth is 1, however that value results in errors |
| 35 | + # when GitPython attempts to push changes: |
| 36 | + # "failed to push some refs" |
| 37 | + fetch-depth: 0 |
| 38 | + token: ${{ secrets.BOT_TOKEN }} |
| 39 | + |
| 40 | + - name: Set up Python |
| 41 | + uses: actions/setup-python@v5 |
| 42 | + with: |
| 43 | + python-version: '3.11' |
| 44 | + |
| 45 | + - name: Install Python dependencies |
| 46 | + run: | |
| 47 | + pip install --upgrade pip pipenv |
| 48 | +
|
| 49 | + - name: Sync Python modules |
| 50 | + run: | |
| 51 | + pipenv sync --system |
| 52 | +
|
| 53 | + # CC Technology team members: |
| 54 | + # See cc-quantifying-bot Google Workspace entry in Bitwarden for |
| 55 | + # information on GCS_ secrets |
| 56 | + - name: Fetch from Google Custom Search (GCS) |
| 57 | + run: | |
| 58 | + ./scripts/1-fetch/gcs_fetch.py \ |
| 59 | + --limit=100 --enable-save --enable-git |
| 60 | + env: |
| 61 | + GCS_DEVELOPER_KEY: ${{ secrets.GCS_DEVELOPER_KEY }} |
| 62 | + GCS_CX: ${{ secrets.GCS_CX }} |
| 63 | + |
| 64 | + - name: Fetch from GitHub |
| 65 | + run: | |
| 66 | + ./scripts/1-fetch/github_fetch.py \ |
| 67 | + --enable-save --enable-git |
| 68 | + env: |
| 69 | + GH_TOKEN: ${{ secrets.BOT_TOKEN }} |
0 commit comments