-
Notifications
You must be signed in to change notification settings - Fork 3
51 lines (41 loc) · 1.33 KB
/
update.yml
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
name: Weekly Update
on:
schedule:
- cron: "0 0 * * 0"
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Set up Emacs
uses: purcell/setup-emacs@master
with:
version: 29.4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install requests module
run: pip3 install requests
- uses: actions/checkout@v4
- name: Find new posts
run: python3 bin/run.py --output-ungrouped --output-grouped-by-year
env:
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
- name: Export org to markdown
run: |
emacs --batch -l bin/convert-to-md.el out.org
emacs --batch -l bin/convert-to-md.el create-toc out_by_year.org
- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "emacs-reddit-tips-n-tricks-bot"
git add *.org *.md comments.json
git commit -m "Weekly update from $(date +%Y-%m-%d)"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: master