-
Notifications
You must be signed in to change notification settings - Fork 49
176 lines (155 loc) · 5.29 KB
/
Copy pathmain.yml
File metadata and controls
176 lines (155 loc) · 5.29 KB
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
name: deploy-website
on:
push:
branches: [ master ]
paths-ignore:
- 'doc/**'
- '**.md'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
#- name: tg-notify
# env:
# TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }}
# TELEGRAM_TO_EN: ${{ secrets.TELEGRAM_TO_EN }}
# TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
# run: |
# ./scripts/newgame-tg.sh
- name: install-dep
run: |
sudo apt -y update || true
sudo apt -y install git python3 python3-jinja2 python3-pip python3-setuptools python3-pil python3-bs4 webp
pip3 install --user OpenCC git+https://github.com/FurryGamesIndex/python-markdown2 ruamel.yaml
python3 --version
cwebp -version
mkdir -p .cache
- name: cache
uses: actions/cache@v4
with:
path: |
.cache
key: FGI-main-cache
- name: fix-mtime
run: |
./scripts/fix-mtime.sh
- name: update-btime
run: |
./scripts/update-btime.py games .cache/btime.json
#- name: lint
# env:
# LINT_OLD_FILES_EXEMPTION: true
# run: |
# ./scripts/dbutils.sh list-game-files | xargs -I{} ./scripts/lint.sh game {}
# ./scripts/dbutils.sh list-game-l10n-files | xargs -I{} ./scripts/lint.sh game-l10n {}
- name: build
run: |
./generate.py \
--images-candidate-webp \
--with-rss \
--mtime-has-fixed \
--btime-file .cache/btime.json \
--plugin steam-cdn-unite,verbose=1 \
--plugin zhconv,critical \
output
mkdir -p output/_internal
cp .cache/btime.json output/_internal/btime.json
- name: ssh-key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY_RSA }}
name: id_rsa
known_hosts: ${{ secrets.KNOWN_HOSTS }}
- name: deploy
run: |
mv .git _git
echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
git config --global user.email "noreply@example.com"
git config --global user.name "deploy-bot"
cd output
git init
git remote add origin git@github.com:FurryGamesIndex/FurryGamesIndex.github.io
git add .
git commit -m 'deploy website'
echo "FGI_GITHUB_PAGES_REV=$(git rev-parse HEAD)" >> "${GITHUB_ENV}"
git push -f origin master
cd ..
rm -rf output
mv _git .git
# - name: cn-build
# run: |
# ./generate.py \
# --no-sitemap \
# --images-candidate-webp \
# --with-rss \
# --mtime-has-fixed \
# --plugin steam-cdn-unite,cdn=china \
# --plugin cn-optimize,rev="$FGI_GITHUB_PAGES_REV" \
# --plugin webp-converter-stub \
# output-cn
#
# - name: cn-deploy
# run: |
# mv .git _git
# echo -e "Host gitlab.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
# git config --global user.email "noreply@example.com"
# git config --global user.name "deploy-bot"
# cd output-cn
# git init
# git remote add origin git@gitlab.com:furrygamesindex/cn-netlify-build.git
# git add .
# git commit -m 'deploy cn website'
# git push -f origin master
# cd ..
# rm -rf output-cn
# mv _git .git
- name: install-frt-rs
run: |
wget https://github.com/FurryGamesIndex/frt-rs/releases/download/_rolling/frt-x86_64-unknown-linux-gnu.gz
gzip -d frt-x86_64-unknown-linux-gnu.gz
mv frt-x86_64-unknown-linux-gnu frt
chmod +x frt
git clone https://github.com/FurryGamesIndex/frt-rs --depth=1
pushd frt-rs
rm -rf demo/www/icons
cp -r ../icons demo/www
popd
- name: next-build-migrate
run: |
pushd frt-rs/demo
../scripts/import-old-gamedb.sh ../../ .
mkdir -p authors
popd
- name: next-build-frt-rs
run: |
pushd frt-rs/demo
../../frt -P profiles/next/profile.toml build && echo "FGI_NEXT_DONE=1" >> "${GITHUB_ENV}"
popd
- name: next-deploy
if: ${{ env.FGI_NEXT_DONE == '1' }}
run: |
mv .git _git
echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
git config --global user.email "noreply@example.com"
git config --global user.name "deploy-bot"
pushd frt-rs/demo/output
git init
git remote add origin git@github.com:FurryGamesIndex/FurryGamesIndex.github.io
git add .
git commit -m 'deploy FGI-next website'
git push -f origin master:next
popd
rm -rf output-next
mv _git .git
- name: sync-mirror
run: |
echo -e "Host gitee.com\n\tStrictHostKeyChecking no\n\tConnectTimeout 5\n" > ~/.ssh/config
git push -f git@gitee.com:furrygamesindex/games.git master || true
echo -e "Host gitlab.com\n\tStrictHostKeyChecking no\n\tConnectTimeout 5\n" > ~/.ssh/config
git push -f git@gitlab.com:furrygamesindex/games.git master || true
echo -e "Host bitbucket.org\n\tStrictHostKeyChecking no\n\tConnectTimeout 5\n" > ~/.ssh/config
git push -f git@bitbucket.org:furrygamesindex/games.git master || true