Daily Data Retrieval Automation #212
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | |
SUPABASE_URL: ${{ secrets.SUPABASE_URL }} | |
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }} | |
DB_TABLE_NAME: ${{ secrets.DB_TABLE_NAME}} | |
LINKEDIN_URL: ${{ secrets.LINKEDIN_URL}} | |
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK}} | |
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 |