-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (45 loc) · 1.87 KB
/
Copy pathweekly_scraper.yml
File metadata and controls
54 lines (45 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Weekly Literature Scraper & Publisher
on:
schedule:
- cron: '0 8 * * 1'
workflow_dispatch:
jobs:
scrape-and-publish:
runs-on: self-hosted
steps:
# 1. Download the Private Repository into a folder named "private-code"
- name: Checkout Private Repo
uses: actions/checkout@v4
with:
path: 'private-code'
# 2. Run the Scraper locally inside the "private-code" folder
- name: Run Scraper Script
working-directory: ./private-code
run: python scraper.py
# 3. Download the Public Repository into a folder named "public-digest"
- name: Checkout Public Repo
uses: actions/checkout@v4
with:
repository: 'JonasBley/public_paper_parser'
token: ${{ secrets.PUBLIC_REPO_TOKEN }}
path: 'public-digest'
# 4. Copy the generated files and push them to the public repository
- name: Push to Public Repo
working-directory: ./public-digest
run: |
# Copy the database and markdown files from the private folder to the public folder
Copy-Item -Path "..\private-code\literature_archive.db" -Destination ".\" -Force
Copy-Item -Path "..\private-code\digest_*.md" -Destination ".\" -Force
# Configure Git credentials
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
# Stage the copied files
git add literature_archive.db
git add digest_*.md
# Commit and Push using native PowerShell logic
if (git status --porcelain) {
git commit -m "Automated weekly literature digest update"
git push
} else {
Write-Host "No new papers found; nothing to commit to the public repository."
}