-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (47 loc) · 1.5 KB
/
update_api.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
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