Update all data #25949
This file contains 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/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 |