Skip to content

Update & Deploy Game Data #338

Update & Deploy Game Data

Update & Deploy Game Data #338

Workflow file for this run

name: Update & Deploy Game Data
on:
schedule:
# UTC time for 10:30 & 16:00 (UTC+8)
- cron: "30 2 * * *"
- cron: "0 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:
check_update:
runs-on: ubuntu-latest
outputs:
result: ${{ steps.condition.outputs.need_update }}
steps:
- name: Cehckout root repo firstly.
uses: actions/checkout@v4
- name: Preparing job
uses: ./.github/actions/prepare-dependences
- name: Check if need to update
id: check_update
run: poetry run python main.py --all --test_update
- name: Set `need_update` Condition
id: condition
if: ${{ github.event_name != 'schedule' || steps.check_update.outputs.test_update == 'true' }}
run: echo "need_update=true" >> "$GITHUB_OUTPUT"
update_deploy:
needs: check_update
if: ${{ needs.check_update.outputs.result == 'true' }}
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Cehckout root repo firstly.
uses: actions/checkout@v4
- name: Preparing job
uses: ./.github/actions/prepare-dependences
- name: Proceed to 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