Skip to content

Commit

Permalink
ci: fix data path
Browse files Browse the repository at this point in the history
  • Loading branch information
eallion committed Aug 16, 2024
1 parent dce8e8b commit 9cd4e82
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/sync-douban-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: OLD_SHA256
run: |
OLD_SHA256=$(sha256sum ${{ env.WORK_DIR }}/data/neodb/movie.json | cut -d ' ' -f 1)
OLD_SHA256=$(sha256sum ${{ env.WORK_DIR }}/assets/data/neodb/movie.json | cut -d ' ' -f 1)
echo "OLD_SHA256=${OLD_SHA256}" >> $GITHUB_ENV
- name: Fetch Movie Data JSON
Expand All @@ -34,7 +34,7 @@ jobs:
id: eallion
type: movie
format: json
dir: ./data/douban
dir: ./assets/data/douban

- name: Sync to NeoDB
uses: lizheming/doumark-action@master
Expand All @@ -59,7 +59,7 @@ jobs:
id: eallion
type: book
format: json
dir: ./data/douban
dir: ./assets/data/douban

- name: Sync Book to NeoDB
uses: lizheming/doumark-action@master
Expand All @@ -85,11 +85,11 @@ jobs:
committer_name: 'github-actions[bot]'
committer_email: 'github-actions[bot]@users.noreply.github.com'
add: |
'./data/douban'
'./assets/data/douban'
- name: CURRENT_SHA256
run: |
CURRENT_SHA256=$(sha256sum ${{ env.WORK_DIR }}/data/neodb/movie.json | cut -d ' ' -f 1)
CURRENT_SHA256=$(sha256sum ${{ env.WORK_DIR }}/assets/data/neodb/movie.json | cut -d ' ' -f 1)
echo "CURRENT_SHA256=${CURRENT_SHA256}" >> $GITHUB_ENV
# 调用另外的 GitHub Actions
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sync-mastodon-status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
# 下载最新的 Mastodon
- name: Download Mastodon Status
run: |
cd data/mastodon/
cd assets/data/mastodon/
rm mastodon.json
url="https://e5n.cc/api/v1/accounts/111136231674527355/statuses?limit=20&exclude_replies=true&exclude_reblogs=true"
output="mastodon.json"
Expand All @@ -49,7 +49,7 @@ jobs:
committer_name: 'github-actions[bot]'
committer_email: 'github-actions[bot]@users.noreply.github.com'
add: |
'./data/mastodon'
'./assets/data/mastodon'
# 调用另外的 GitHub Actions
- name: Sync NeoDB Data
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/sync-neodb-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Get Local Current UUID
run: |
CURRENT_UUID() {
jq '.data[0].item.uuid' data/neodb/movie.json
jq '.data[0].item.uuid' assets/data/neodb/movie.json
}
echo "CURRENT_UUID=$(CURRENT_UUID)" >> $GITHUB_ENV
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:
jq -c -s '{data: map(.data[]) | unique | sort_by(.created_time) | reverse, pages: map(.pages)[0], count: map(.count)[0]}' *.json > movie.json
# 更新 NeoDB 数据
cp -f movie.json ${{ env.WORK_DIR }}/data/neodb/
cp -f movie.json ${{ env.WORK_DIR }}/assets/data/neodb/
- name: Download NeoDB Cover
if: ${{ env.REMOTE_UUID != env.CURRENT_UUID }}
Expand All @@ -162,7 +162,7 @@ jobs:
fi
# 读取本地的 movie.json 文件内容
json=$(cat data/neodb/movie.json)
json=$(cat assets/data/neodb/movie.json)
# 提取图片 URL
image_urls=$(echo "$json" | jq -r '.data[].item.cover_image_url')
Expand Down Expand Up @@ -205,7 +205,7 @@ jobs:
committer_name: 'github-actions[bot]'
committer_email: 'github-actions[bot]@users.noreply.github.com'
add: |
'./data/neodb'
'./assets/data/neodb'
'./assets/images/neodb/cover'
# # 调用另外的 GitHub Actions 构建 Hugo
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/sync-steam-web-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,32 +35,32 @@ jobs:
# 获取本地现有文件中最新的 Count
- name: Get Local Current MD5
run: |
LOCAL_MD5=$(md5sum data/steam/steam_web_api.json | cut -d ' ' -f 1)
LOCAL_MD5=$(md5sum assets/data/steam/steam_web_api.json | cut -d ' ' -f 1)
echo "LOCAL_MD5=$LOCAL_MD5" >> $GITHUB_ENV
rm data/steam/*.json
rm assets/data/steam/*.json
# 获取远程最新的 Count
- name: Get Steam Latest OwnedGames
run: |
curl -X 'GET' \
'https://api.steampowered.com/IPlayerService/GetOwnedGames/v1/?key=${{ secrets.STEAM_WEB_API_KEY }}&steamid=76561197989210276&include_appinfo=true&include_played_free_games=true&format=json' \
-H 'accept: application/json' > data/steam/owned_games.json
-H 'accept: application/json' > assets/data/steam/owned_games.json
- name: Fetch Steam Badges
run: |
curl -X 'GET' \
'https://api.steampowered.com/IPlayerService/GetBadges/v1/?key=${{ secrets.STEAM_WEB_API_KEY }}&steamid=76561197989210276&format=json' \
-H 'accept: application/json' > data/steam/badges.json
-H 'accept: application/json' > assets/data/steam/badges.json
- name: Fetch Steam Player Summaries
run: |
curl -X 'GET' \
'https://api.steampowered.com/ISteamUser/GetPlayerSummaries/v2/?key=${{ secrets.STEAM_WEB_API_KEY }}&steamids=76561197989210276&format=json' \
-H 'accept: application/json' > data/steam/player.json
-H 'accept: application/json' > assets/data/steam/player.json
- name: Merge JSON Files
run: |
cd data/steam
cd assets/data/steam
jq -s 'reduce .[] as $item ({}; . * $item)' *.json > unsorted_steam_web_api.json
# 读取JSON文件并提取games数组
Expand All @@ -79,7 +79,7 @@ jobs:
cd ../..
CURRENT_MD5=$(md5sum data/steam/steam_web_api.json | cut -d ' ' -f 1)
CURRENT_MD5=$(md5sum assets/data/steam/steam_web_api.json | cut -d ' ' -f 1)
echo "CURRENT_MD5=$CURRENT_MD5" >> $GITHUB_ENV
- name: Download Steam Cover
Expand All @@ -90,7 +90,7 @@ jobs:
fi
# 读取本地的 steam_web_api.json 文件内容
json=$(cat data/steam/steam_web_api.json)
json=$(cat assets/data/steam/steam_web_api.json)
# 提取图片 URL
appIds=$(echo "$json" | jq -r '.response.games[].appid')
Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:
committer_name: 'github-actions[bot]'
committer_email: 'github-actions[bot]@users.noreply.github.com'
add: |
'./data/steam'
'./assets/data/steam'
# # 调用另外的 GitHub Actions 构建 Hugo
- name: Build Hugo and Deploy
Expand Down

0 comments on commit 9cd4e82

Please sign in to comment.