Skip to content

Scrape

Scrape #1024

Workflow file for this run

name: Scrape
on:
workflow_dispatch:
inputs:
accountsToScrape:
default: ""
required: false
description: "Accounts to scrape (comma separated)"
daysBack:
default: "10"
required: false
description: "Days back to scrape"
worksheetName:
default: "auto_moneyman"
required: false
description: "The name of the worksheet to write to"
parallelScrapes:
default: "1"
required: false
description: "Number of parallel scrapes to run"
schedule:
# In Israel: [12:05, 00:05] or [13:05, 01:05] on DST
- cron: "5 10,22 * * *"
env:
REGISTRY: ghcr.io
MAX_PARALLEL_SCRAPERS: 3
jobs:
scrape:
runs-on: ubuntu-latest
steps:
- id: normalize-repository-name
run: echo "repository=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
- name: Pull image
run: docker pull ${{ env.REGISTRY }}/${{ steps.normalize-repository-name.outputs.repository }}:latest
- name: Run scraper
run: docker run --rm
-e DEBUG
-e DAYS_BACK
-e TZ
-e WORKSHEET_NAME
-e ACCOUNTS_JSON
-e TELEGRAM_API_KEY
-e TELEGRAM_CHAT_ID
-e GOOGLE_SHEET_ID
-e GOOGLE_SERVICE_ACCOUNT_EMAIL
-e GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY
-e ACCOUNTS_TO_SCRAPE
-e ADE_DATABASE_NAME
-e ADE_TABLE_NAME
-e ADE_INGESTION_MAPPING
-e ADE_INGEST_URI
-e AZURE_TENANT_ID
-e AZURE_APP_ID
-e AZURE_APP_KEY
-e YNAB_TOKEN
-e YNAB_BUDGET_ID
-e YNAB_ACCOUNTS
-e BUXFER_USER_NAME
-e BUXFER_PASSWORD
-e BUXFER_ACCOUNTS
-e TRANSACTION_HASH_TYPE
-e WEB_POST_URL
-e MAX_PARALLEL_SCRAPERS
${{ env.REGISTRY }}/${{ steps.normalize-repository-name.outputs.repository }}:latest
env:
DEBUG: ""
TZ: "Asia/Jerusalem"
DAYS_BACK: ${{ github.event.inputs.daysBack }}
WORKSHEET_NAME: ${{ github.event.inputs.worksheetName }}
ACCOUNTS_TO_SCRAPE: ${{ github.event.inputs.accountsToScrape }}
ACCOUNTS_JSON: ${{ secrets.ACCOUNTS_JSON }}
TELEGRAM_API_KEY: ${{ secrets.TELEGRAM_API_KEY }}
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
GOOGLE_SHEET_ID: ${{ secrets.GOOGLE_SHEET_ID }}
GOOGLE_SERVICE_ACCOUNT_EMAIL: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_EMAIL }}
GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY }}
ADE_DATABASE_NAME: ${{ secrets.ADE_DATABASE_NAME }}
ADE_TABLE_NAME: ${{ secrets.ADE_TABLE_NAME }}
ADE_INGESTION_MAPPING: ${{ secrets.ADE_INGESTION_MAPPING }}
ADE_INGEST_URI: ${{ secrets.ADE_INGEST_URI }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_APP_ID: ${{ secrets.AZURE_APP_ID }}
AZURE_APP_KEY: ${{ secrets.AZURE_APP_KEY }}
YNAB_TOKEN: ${{ secrets.YNAB_TOKEN }}
YNAB_BUDGET_ID: ${{ secrets.YNAB_BUDGET_ID }}
YNAB_ACCOUNTS: ${{ secrets.YNAB_ACCOUNTS }}
BUXFER_USER_NAME: ${{ secrets.BUXFER_USER_NAME }}
BUXFER_PASSWORD: ${{ secrets.BUXFER_PASSWORD }}
BUXFER_ACCOUNTS: ${{ secrets.BUXFER_ACCOUNTS }}
TRANSACTION_HASH_TYPE: ${{ secrets.TRANSACTION_HASH_TYPE }}
WEB_POST_URL: ${{ secrets.WEB_POST_URL }}
MAX_PARALLEL_SCRAPERS: ${{ github.event.inputs.parallelScrapes || env.MAX_PARALLEL_SCRAPERS }}