Files
blitzkit/.github/workflows/website.yml
T
2026-08-05 13:43:10 -05:00

135 lines
3.1 KiB
YAML

name: Website
on:
push:
workflow_dispatch:
schedule:
- cron: "0 4 * * *"
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref == 'refs/heads/main' }}
env:
# blitzkit
PUBLIC_BRANCH: main
PUBLIC_PROMOTE_OPENTEST: false
PUBLIC_STATIC_ASSET_BASE: https://assets.blitzkit.app
PUBLIC_GUIDE_WEBSITE: https://guidesblitz.com
# blitz
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
WOTB_GLOSSARY_DOMAIN: ${{ secrets.WOTB_GLOSSARY_DOMAIN }}
WOTB_GLOSSARY_PATH: ${{ secrets.WOTB_GLOSSARY_PATH }}
GAME_DIR: temp/game
# google
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
# wargaming
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
# steam
STEAM_USERNAME: ${{ secrets.STEAM_USERNAME }}
STEAM_PASSWORD: ${{ secrets.STEAM_PASSWORD }}
STEAM_APP: 444202
STEAM_OS: windows
jobs:
build:
name: Build website
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
chunk: [default, api]
steps:
- name: Free disk space
uses: jlumbroso/free-disk-space@main
- name: Checkout
uses: actions/checkout@v6
with:
submodules: recursive
token: ${{ secrets.GH_TOKEN }}
- name: Setup bun
uses: oven-sh/setup-bun@v2
- name: Setup protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GH_TOKEN }}
- name: Configure pages
uses: actions/configure-pages@v6
- name: Install dependencies
run: bun install
- name: Setup DepotDownloader
run: |
REPO_USER="SteamRE"
REPO_NAME="DepotDownloader"
TEMP="temp"
OUT="$TEMP/$REPO_NAME"
ZIP="$TEMP/$REPO_NAME.zip"
URL=$(
curl -s "https://api.github.com/repos/$REPO_USER/$REPO_NAME/releases/latest" \
| jq -r '.assets[]
| select(.name | contains("linux-x64"))
| .browser_download_url' \
| head -n 1
)
mkdir -p "$TEMP"
curl -L "$URL" -o "$ZIP"
unzip -p "$ZIP" "$REPO_NAME" > "$OUT"
rm "$ZIP"
chmod +x "$OUT"
- name: Download game
run: |
TEMP="temp"
DEPOT_DOWNLOADER="$TEMP/DepotDownloader"
GAME="$TEMP/game"
$DEPOT_DOWNLOADER -os $STEAM_OS -app $STEAM_APP -username $STEAM_USERNAME -password $STEAM_PASSWORD -dir $GAME
- name: Build
run: bun run build
env:
BUILD_CHUNK: ${{ matrix.chunk }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v5
with:
path: dist/website
deploy-github-pages:
if: ${{ github.ref == 'refs/heads/production' }}
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
needs: build
environment:
name: Production
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5