mirror of
https://github.com/LizardByte/GameDB.git
synced 2026-10-23 03:36:51 +09:00
84 lines
2.4 KiB
YAML
84 lines
2.4 KiB
YAML
---
|
|
name: Update
|
|
permissions: {}
|
|
|
|
env:
|
|
PYTHON_VERSION: '3.14'
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- master
|
|
schedule:
|
|
- cron: '0 0 * * *' # every day at midnight
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: "${{ github.workflow }}-${{ github.ref }}"
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
update:
|
|
permissions:
|
|
contents: read
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
- name: Cache
|
|
id: cache
|
|
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
|
with:
|
|
path: cache
|
|
key: update-${{ github.sha }}
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
|
with:
|
|
python-version: ${{ env.PYTHON_VERSION }}
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
|
with:
|
|
enable-cache: true
|
|
|
|
- name: Install Python dependencies
|
|
run: uv sync --locked --python "${PYTHON_VERSION}" --no-python-downloads
|
|
|
|
- name: Update
|
|
env:
|
|
TWITCH_CLIENT_ID: ${{ secrets.TWITCH_CLIENT_ID }}
|
|
TWITCH_CLIENT_SECRET: ${{ secrets.TWITCH_CLIENT_SECRET }}
|
|
YOUTUBE_API_KEY: ${{ secrets.YOUTUBE_API_KEY }}
|
|
run: uv run --no-sync python -u ./src/update_db.py ${{ github.event_name == 'pull_request' && '-t' || '' }}
|
|
|
|
- name: Prepare Artifacts # uploading artifacts will fail if not zipped due to very large quantity of files
|
|
shell: bash
|
|
run: 7z a build.zip ./gh-pages/* ./gh-pages-template/*
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: update
|
|
path: ${{ github.workspace }}/build.zip
|
|
if-no-files-found: error
|
|
include-hidden-files: true
|
|
retention-days: 1
|
|
|
|
call-jekyll-build:
|
|
needs: update
|
|
permissions:
|
|
contents: read
|
|
uses: LizardByte/LizardByte.github.io/.github/workflows/jekyll-build.yml@master
|
|
secrets:
|
|
GH_BOT_EMAIL: ${{ secrets.GH_BOT_EMAIL }}
|
|
GH_BOT_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
|
|
with:
|
|
gh_bot_name: ${{ vars.GH_BOT_NAME }}
|
|
site_artifact: 'update'
|
|
extract_archive: 'build.zip'
|
|
target_branch: 'gh-pages'
|
|
clean_gh_pages: true
|