diff --git a/.github/workflows/run-rs-daily.yml b/.github/workflows/run-rs-daily.yml new file mode 100644 index 0000000..e465915 --- /dev/null +++ b/.github/workflows/run-rs-daily.yml @@ -0,0 +1,40 @@ +name: Run Relative Strength Daily + +on: + schedule: + - cron: '0 0 * * *' # Daily at midnight UTC + workflow_dispatch: # Allows manual trigger + +jobs: + run-scripts: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' # Matches the repo's Python version + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Run scripts + run: | + python rs_data.py # Aggregates price data + python rs_ranking.py # Calculates rankings + # Alternatively, if you prefer the all-in-one: python relative-strength.py + + - name: Commit and push outputs + run: | + git config --global user.name "GitHub Actions" + git config --global user.email "actions@github.com" + git add output/* + git commit -m "Update RS outputs from daily run" || echo "No changes to commit" + git push + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/run-rs-daily2.yml b/.github/workflows/run-rs-daily2.yml new file mode 100644 index 0000000..0fed7da --- /dev/null +++ b/.github/workflows/run-rs-daily2.yml @@ -0,0 +1,45 @@ +name: Run Relative Strength Daily + +on: + schedule: + - cron: '0 0 * * *' # Daily at midnight UTC + workflow_dispatch: # Allows manual trigger + +jobs: + run-scripts: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Verify requirements + run: | + ls -l requirements.txt || echo "requirements.txt not found" + cat requirements.txt || echo "Failed to read requirements.txt" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Run scripts + run: | + python rs_data.py + python rs_ranking.py + # Alternatively: python relative-strength.py + + - name: Commit and push outputs + run: | + git config --global user.name "GitHub Actions" + git config --global user.email "actions@github.com" + git add output/* + git commit -m "Update RS outputs from daily run" || echo "No changes to commit" + git push + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}