-
-
Notifications
You must be signed in to change notification settings - Fork 55
62 lines (52 loc) · 1.62 KB
/
generate-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
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Generate feeds and site
on:
push:
branches: [ main ]
schedule:
# NOTE: UTCなので9時間引く
# 平日 8~24時の1時間おき
# TODO: 9時(UTC0時)が実行されないことがあるので解決したい。恐らく0時登録が多いため実行されづらい
- cron: 0 23,0-15 * * 1-5
# 休日 8~24時の2時間おき
- cron: 0 23,1,3,5,7,9,11,13,15 * * 0,6
workflow_dispatch:
jobs:
generate-feed:
name: Generate Feed
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
ref: main
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: .tool-versions
cache: npm
- name: Install node packages
run: npm ci
- name: Get date
id: get-date
run: |
echo "date=$(date -u -I)" >> "$GITHUB_OUTPUT"
shell: bash
- name: Cache feed images
uses: actions/cache@v4
with:
path: .cache
key: ${{ runner.os }}-feed-images-${{ steps.get-date.outputs.date }}
- name: Generate feed
run: npm run feed-generate
- name: Generate site
run: npm run site-build
- name: Push to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
# NOTE: 変更履歴が必要な場合は false に変更
force_orphan: true
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'