-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (81 loc) · 2.8 KB
/
update.yaml
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Update & Deploy Game Data
on:
# Runs on pushes targeting the default branch & docs/website/ directory
push:
branches: ["main"]
paths: ["docs/website/**"]
schedule:
# UTC time for 10:30 & 16:10 (UTC+8)
- cron: "30 2 * * *"
- cron: "10 8 * * *"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Global permissions configuration starts here
permissions:
# 'write' access to repository contents
contents: write
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "update_pages"
cancel-in-progress: false
jobs:
update:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Cehckout root repo firstly.
uses: actions/checkout@v4
- name: Checkout ArknightsGameData Repo.
uses: actions/checkout@v4
with:
repository: "Kengxxiao/ArknightsGameData"
path: "Github/ArknightsGameData"
filter: "blob:none"
sparse-checkout: "zh_CN/gamedata/"
- name: Checkout ArknightsGameResource Repo.
uses: actions/checkout@v4
with:
repository: "yuanyan3060/ArknightsGameResource"
path: "Github/ArknightsGameResource"
filter: "blob:none"
sparse-checkout: "gamedata/"
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "poetry"
- run: poetry install
- name: Test if need to update
id: test_update
run: poetry run python main.py --all --test_update
- name: No need to update!
if: ${{ github.event_name == 'schedule' && steps.test_update.outputs.test_update == 'false' }}
run: exit 0
- name: Fetch cache fonts
uses: actions/cache@v4
id: cache-fonts
with:
path: tmp
key: SarasaMonoSlabSC-TTF-Unhinted-fonts-cache
- name: Download Fonts (if not cached)
if: steps.cache-fonts.outputs.cache-hit != 'true'
uses: ./.github/actions/download-fonts
- name: Auto Update & Commit
uses: ./.github/actions/auto-update
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload docs/website/ directory
path: "docs/website/"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4