Update Json files #30925
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: Update Json files | |
on: | |
workflow_dispatch: | |
schedule: | |
# schedule does not support timezone, so use UTC | |
# https://github.com/actions/runner/issues/1423 | |
# https://github.community/t/timezone-support-for-scheduled-actions/17279 | |
- cron: '0 01-23/2 * * *' | |
# - cron: '0 * * * *' | |
jobs: | |
push_json_and_rssfeed: | |
name: Update Json files | |
runs-on: ubuntu-latest | |
env: | |
TZ: Asia/Tokyo | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PUSH_ACCESS_TOKEN: ${{ secrets.PUSH_ACCESS_TOKEN }} | |
GH_READONLY_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PROJECT_USER_NAME: AndroidDagashi | |
PROJECT_REPO_NAME: androiddagashi.github.io | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: development | |
persist-credentials: false | |
# run corepack before setup-node | |
# https://github.com/actions/setup-node/issues/899 | |
- run: corepack enable yarn | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.node-version' | |
cache: 'yarn' | |
- name: Setup git config | |
run: sh ./.github/setup-git-config.sh | |
- name: yarn install | |
run: yarn install | |
- name: Generate json resources | |
run: yarn api:generate | |
- name: Generate RSS feed | |
run: yarn rss:generate | |
- name: Push generated files if there's any update | |
run: sh ./.github/push-resources-if-updated.sh | |
- name: Print debug info | |
if: failure() | |
run: | | |
git remote | |
git status |