-
Notifications
You must be signed in to change notification settings - Fork 17
63 lines (56 loc) · 1.49 KB
/
update.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
58
59
60
61
62
63
name: Update all data
on:
push:
workflow_dispatch:
schedule:
- cron: "40 * * * *"
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 1
matrix:
server: [CN, EN, JP, KR, TW]
env:
IMAGE_NAME: ghcr.io/azurlanetools/azex/azex
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: "azexbot"
password: ${{ secrets.GHCR_TOKEN }}
- name: Load cache
uses: actions/cache@v4
with:
key: azex-dbcachev2-${{ matrix.server }}-${{ github.run_id }}
path: "cache"
restore-keys: |
azex-dbcachev2-${{ matrix.server }}
- name: Checkout target repo
uses: actions/checkout@v4
with:
path: output/json
- name: Pull docker image
uses: gacts/run-and-post-run@v1.4
with:
run: docker pull $IMAGE_NAME
post: docker image rm -f $IMAGE_NAME
- name: Generate json data
run: >
docker run --rm --name azex-json
-e AZEX_USER=$(id -u):$(id -g)
-v $PWD:/azex
$IMAGE_NAME
python -m azex json ${{ matrix.server }}
- name: Save changes
run: |
# push
cd output/json
if [ -f .git/commit_msg ]; then
git add .
git pull
git commit -F .git/commit_msg
git push
fi