giladneiger is running Discourse Leaderboard π #40
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: Discourse Leaderboard | |
run-name: ${{ github.actor }} is running Discourse Leaderboard π | |
on: | |
workflow_dispatch: | |
inputs: | |
from_date: | |
description: 'Start date from which to quary topics, `YYYY-MM-DD` format (e.g 2023-01-01)' | |
required: true | |
default: '' | |
to_date: | |
description: 'End date until which to quary topics, `YYYY-MM-DD` format (e.g 2023-04-01)' | |
required: true | |
default: '' | |
logLevel: | |
type: choice | |
description: 'Log level' | |
required: false | |
options: | |
- info | |
- debug | |
jobs: | |
leaderBoardArtifact: | |
env: | |
DISCOURSE_USER: 'shaked.dotan' | |
runs-on: ubuntu-latest | |
# runs-on: python:3.9.16-slim | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.9" | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Run python main.py | |
run: > | |
python main.py | |
--user ${{ env.DISCOURSE_USER }} | |
--token ${{ secrets.DISCOURSE_TOKEN }} | |
--start_date ${{ github.event.inputs.from_date }} | |
--end_date ${{ github.event.inputs.to_date }} | |
- name: Archive png file | |
uses: actions/upload-artifact@v3 | |
with: | |
name: png artifact | |
path: discourse_leaderboard.png | |
retention-days: 5 | |