Update all data #35130
This file contains hidden or 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 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/lua | |
- 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 lua data | |
run: > | |
docker run --rm --name azex-lua | |
-e AZEX_USER=$(id -u):$(id -g) | |
-v $PWD:/azex | |
$IMAGE_NAME | |
python -m azex lua ${{ matrix.server }} | |
- name: Save changes | |
run: | | |
# push | |
cd output/lua | |
if [ -f .git/commit_msg ]; then | |
git add . | |
git pull | |
git commit -F .git/commit_msg | |
git push | |
fi |