Skip to content

Run Python Script and Push to Another Repo #1467

Run Python Script and Push to Another Repo

Run Python Script and Push to Another Repo #1467

Workflow file for this run

name: Run Python Script and Push to Another Repo
on:
schedule:
- cron: "0 */8 * * *"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Install Monaco Font
run: |
sudo mkdir -p /usr/share/fonts/truetype/custom
sudo cp fonts/Monaco.ttf /usr/share/fonts/truetype/custom
sudo fc-cache -f -v
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install Python dependencies
run: |
pip install -r requirements.txt
- name: Run script
run: python main.py
env:
LEETCODE_SESSION: ${{ secrets.LEETCODE_SESSION }}
LC_EMAIL: ${{ secrets.LC_EMAIL }}
LC_PASSWORD: ${{ secrets.LC_PASSWORD }}
APP_PASSWORD: ${{ secrets.APP_PASSWORD }}
EMAIL: ${{ secrets.EMAIL }}
PHONE_NUMBER: ${{ secrets.PHONE_NUMBER }}
- name: Checkout 'LeetCode-Points-Graph' repository
uses: actions/checkout@v2
with:
repository: adeshpande03/LeetCode-Points-Graph
token: ${{ secrets.README_PAT }}
path: "LeetCode-Points-Graph"
- name: Copy points_graph.png to 'LeetCode-Points-Graph' repository
run: |
cp points_graph_rounded_corners.png LeetCode-Points-Graph/
cp logs.log LeetCode-Points-Graph/
cp data.csv LeetCode-Points-Graph/
- name: Commit and push to 'LeetCode-Points-Graph' repository
run: |
cd LeetCode-Points-Graph
git config --global user.name 'Akhil Deshpande'
git config --global user.email '[email protected]'
git add .
git commit -m "Update points_graph_rounded_corners.png"
git push