Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(feed): キャッシュのキーは毎回変えて保存しrestore-keysで最新をとるように #207

Merged
merged 2 commits into from
Dec 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,24 +99,24 @@ jobs:
node-version-file: .tool-versions
cache: npm
- run: npm ci
- name: Restore feed images cache
uses: actions/cache/restore@v4
- uses: actions/cache/restore@v4
with:
path: |
.cache
public/images/feed-thumbnails
public/images/feed-icons
key: ${{ runner.os }}-feed-images-${{ hashFiles('src/resources/feed-info-list.ts') }}
# キャッシュのキーは毎回変えて保存。restore-keys によって最新が使われる
# see: https://github.com/actions/cache/issues/342#issuecomment-673371329
key: ${{ runner.os }}-feed-images-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-feed-images-
- run: npm run feed-generate
- run: npm run site-prepare
- run: npm run site-build
- name: Save feed images cache
uses: actions/cache/save@v4
- uses: actions/cache/save@v4
with:
path: |
.cache
public/images/feed-thumbnails
public/images/feed-icons
key: ${{ runner.os }}-feed-images-${{ hashFiles('src/resources/feed-info-list.ts') }}
key: ${{ runner.os }}-feed-images-${{ github.run_id }}
15 changes: 7 additions & 8 deletions .github/workflows/generate-feed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,28 @@ jobs:
node-version-file: .tool-versions
cache: npm
- run: npm ci
- name: Restore feed images cache
uses: actions/cache/restore@v4
- uses: actions/cache/restore@v4
with:
path: |
.cache
public/images/feed-thumbnails
public/images/feed-icons
key: ${{ runner.os }}-feed-images-${{ hashFiles('src/resources/feed-info-list.ts') }}
# キャッシュのキーは毎回変えて保存。restore-keys によって最新が使われる
# see: https://github.com/actions/cache/issues/342#issuecomment-673371329
key: ${{ runner.os }}-feed-images-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-feed-images-
- run: npm run feed-generate
- run: npm run site-prepare
- run: npm run site-build
- name: Save feed images cache
uses: actions/cache/save@v4
- uses: actions/cache/save@v4
with:
path: |
.cache
public/images/feed-thumbnails
public/images/feed-icons
key: ${{ runner.os }}-feed-images-${{ hashFiles('src/resources/feed-info-list.ts') }}
- name: Push to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
key: ${{ runner.os }}-feed-images-${{ github.run_id }}
- uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
Expand Down
Loading