Skip to content

Daily Data Retrieval Automation #142

Daily Data Retrieval Automation

Daily Data Retrieval Automation #142

Workflow file for this run

name: Daily Data Retrieval Automation
on:
schedule:
- cron: "0 21 */2 * *" # Runs every other day at 9PM UTC (2PM PST the same day)
workflow_dispatch: # Allow manual trigger
jobs:
run-script:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Virtual enviornment set up
run: |
python -m venv venv
source venv/bin/activate
# If theres no changes in the requirements.txt file it will pull all the dependences from cache
- name: cache environment
id: cached-dependencies
uses: actions/cache@v3
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}
- if: steps.cached-dependencies.outputs.cache-hit != 'true'
name: install python packages
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run script
run: python main.py --days-needed 2
# Custom CLI Command
# fmt: off
#LINT.IF .env.example
env:
LINKEDIN_URL: ${{ secrets.LINKEDIN_URL}}
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK}}
DB_URI: ${{ secrets.DB_URI}}
DB_TABLE: ${{ secrets.DB_TABLE}}
PALM_API_KEY: ${{ secrets.PALM_API_KEY}}
LINKEDIN_INTERN_URL: ${{ secrets.LINKEDIN_INTERN_URL}}
GH_INTERN24_URL: ${{ secrets.GH_INTERN24_URL}}
PROMPTS_PATH: ${{ secrets.PROMPTS_PATH}}
MESSAGE_PATH: ${{ secrets.MESSAGE_PATH}}
#LINT.END
# fmt: on