refactor(publish): use alternative filename in index.html #12
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 & Deploy Game Data | |
on: | |
# Runs on pushes targeting the default branch & docs/website/ directory | |
push: | |
branches: ["main"] | |
paths: ["docs/website/**"] | |
schedule: | |
# UTC time for 10:30 & 16:10 (UTC+8) | |
- cron: "30 2 * * *" | |
- cron: "10 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: | |
update: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cehckout root repo firstly. | |
uses: actions/checkout@v4 | |
- name: Checkout ArknightsGameData Repo. | |
uses: actions/checkout@v4 | |
with: | |
repository: "Kengxxiao/ArknightsGameData" | |
path: "Github/ArknightsGameData" | |
filter: "blob:none" | |
sparse-checkout: "zh_CN/gamedata/" | |
- name: Checkout ArknightsGameResource Repo. | |
uses: actions/checkout@v4 | |
with: | |
repository: "yuanyan3060/ArknightsGameResource" | |
path: "Github/ArknightsGameResource" | |
filter: "blob:none" | |
sparse-checkout: "gamedata/" | |
- name: Install poetry | |
run: pipx install poetry | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
cache: "poetry" | |
- run: poetry install | |
- name: Test if need to update | |
id: test_update | |
run: poetry run python main.py --all --test_update | |
- name: No need to update! | |
if: ${{ github.event_name == 'schedule' && steps.test_update.outputs.test_update == 'false' }} | |
run: exit 0 | |
- name: Fetch cache fonts | |
uses: actions/cache@v4 | |
id: cache-fonts | |
with: | |
path: tmp | |
key: SarasaMonoSlabSC-TTF-Unhinted-fonts-cache | |
- name: Download Fonts (if not cached) | |
if: steps.cache-fonts.outputs.cache-hit != 'true' | |
uses: ./.github/actions/download-fonts | |
- name: Auto 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 |