Update #2043
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 | |
| 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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Cache | |
| id: cache | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: cache | |
| key: update-${{ github.sha }} | |
| - name: Set up Python | |
| uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 | |
| 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 |