Generate feeds and site #15093
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: 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' |