mirror of https://github.com/Bunsly/JobSpy
74 lines
2.2 KiB
YAML
74 lines
2.2 KiB
YAML
name: JobSpy Scraper Dynamic Workflow
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
user_email:
|
|
description: 'User email for the scraper'
|
|
required: true
|
|
default: 'branden@autoemployme.onmicrosoft.com'
|
|
search_terms:
|
|
description: 'Comma-separated list of search terms'
|
|
required: true
|
|
default: 'IT Support,CRM,Automation'
|
|
results_wanted:
|
|
description: 'Number of results to fetch'
|
|
required: true
|
|
default: '100'
|
|
max_days_old:
|
|
description: 'Fetch jobs posted in the last n days'
|
|
required: true
|
|
default: '2'
|
|
target_state:
|
|
description: 'Target state (e.g. NY)'
|
|
required: true
|
|
default: 'NY'
|
|
|
|
permissions:
|
|
actions: read
|
|
contents: read
|
|
id-token: write
|
|
|
|
jobs:
|
|
scrape_jobs:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.10'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
|
|
- name: Set environment variables
|
|
run: |
|
|
echo "USER_EMAIL=${{ github.event.inputs.user_email }}" >> $GITHUB_ENV
|
|
echo "SEARCH_TERMS=${{ github.event.inputs.search_terms }}" >> $GITHUB_ENV
|
|
echo "RESULTS_WANTED=${{ github.event.inputs.results_wanted }}" >> $GITHUB_ENV
|
|
echo "MAX_DAYS_OLD=${{ github.event.inputs.max_days_old }}" >> $GITHUB_ENV
|
|
echo "TARGET_STATE=${{ github.event.inputs.target_state }}" >> $GITHUB_ENV
|
|
|
|
- name: Run JobSpy Scraper Dynamic
|
|
run: python job_scraper_dynamic.py
|
|
|
|
- name: Verify jobspy_output_dynamic.csv exists
|
|
run: |
|
|
if [ ! -f jobspy_output_dynamic.csv ]; then
|
|
echo "❌ ERROR: jobspy_output_dynamic.csv not found!"
|
|
exit 1
|
|
else
|
|
echo "✅ jobspy_output_dynamic.csv found."
|
|
fi
|
|
|
|
- name: Upload JobSpy Output as Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: jobspy-results-dynamic
|
|
path: jobspy_output_dynamic.csv
|