Skip to content

Summarize Articles #130

Summarize Articles

Summarize Articles #130

Workflow file for this run

name: Summarize Articles
env:
FIREWORKS_API_KEY: ${{ secrets.FIREWORKS_API_KEY }}
on:
workflow_dispatch:
inputs:
force_generate_all:
description: 'Force generate summaries for all posts'
required: false
type: boolean
default: false
schedule:
- cron: '0 10 * * 2'
jobs:
scheduled:
runs-on: ubuntu-latest
environment: summarize
steps:
- name: Check out this repo
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: 3.9
cache: 'pip'
cache-dependency-path: |
requirements-summarizer.txt
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y jq
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-build.txt
python -m pip install -r requirements-summarizer.txt
python -m pip install -r requirements-langchain.txt
- name: Fetch File from Repo #2
run: |
curl -f -O "https://raw.githubusercontent.com/wesslen/arxiv-frontpage/main/data/input.jsonl"
mv input.jsonl data/input.jsonl
git config user.name "Automated"
git config user.email "actions@users.noreply.github.com"
git add data/input.jsonl
timestamp=$(date -u)
git commit -m "Update input.jsonl from Frontpage: ${timestamp}" || exit 0
git push
- name: Run summarization
run: |
FORCE_FLAG=""
if [ ${{ github.event.inputs.force_generate_all }} = true ]; then
FORCE_FLAG="--force-generate-all"
fi
python scripts/summarizer.py data/input.jsonl $FORCE_FLAG
- name: Commit and push if it changed
run: |-
git config user.name "Automated"
git config user.email "actions@users.noreply.github.com"
git add data/output.jsonl
timestamp=$(date -u)
git commit -m "Latest data: ${timestamp}" || exit 0
git push