-
Notifications
You must be signed in to change notification settings - Fork 24
49 lines (46 loc) · 1.59 KB
/
update-feed.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
name: Update
on:
workflow_dispatch:
push:
branches:
- main
schedule:
# Adjust refresh schedule here. By default, it runs once per day.
# Syntax reference: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#schedule
# Recommended tool: https://crontab.guru/
- cron: "12 5 * * *"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download ArxivFeed
env:
GITHUB_PAT: ${{ github.token }}
REPO: "NotCraft/ArxivFeed"
VERSION: "latest"
MATCH: "arxivfeed-.+-x86_64-unknown-linux-musl.tar.gz$"
RENAME: "arxivfeed.tgz"
shell: bash
run: |
curl -sL --fail \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer ${GITHUB_PAT}" \
"https://api.github.com/repos/${REPO}/releases/${VERSION}" \
| jq -r ".assets | .[] | select(.name | test(\"${MATCH}\")) | .url" \
| tee asset.url
curl -sL --fail \
-H "Accept: application/octet-stream" \
-H "Authorization: Bearer ${GITHUB_PAT}" \
-o "${RENAME}" \
"$(cat asset.url)"
tar -zxvf arxivfeed.tgz --strip-components 1 $(tar tf arxivfeed.tgz | grep /arxivfeed)
chmod +x arxivfeed
- name: Build rss
run: ./arxivfeed
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target
force_orphan: true