This repository has been archived by the owner on Jun 10, 2024. It is now read-only.
Scrape and Push to Private Repo #39
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: Scrape and Push to Private Repo | |
on: | |
schedule: | |
- cron: "0 4 * * *" # Runs every day at 4 AM | |
workflow_dispatch: # Allows manual runs | |
jobs: | |
scrape-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Private Repo | |
uses: actions/checkout@v2 | |
with: | |
repository: "5ademni/job-scraper" | |
token: ${{ secrets.GH_PAT }} # A GitHub PAT that has access to your private repo | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.x" | |
- name: Install dependencies | |
run: pip install -r requirements.txt | |
- name: Run Scraper | |
run: python main.py | |
- name: Commit Scraped Data | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add . | |
git commit -m "Update scraped data" | |
- name: Push to Private Repo | |
run: git push |