pokerogue/.github/workflows/github-pages.yml
Sirz Benjie 8216a379bf
[Dev][GitHub] Update to node 22 (#5586)
* Update node and workflows to use version 22.14

* Update @types/node package

* Update engines field in package.json

* Hardcode node version in github pages workflow

* Update to checkout@v4 in github pages workflow
2025-04-14 12:37:26 -05:00

72 lines
1.7 KiB
YAML

name: "Github Pages"
on:
push:
branches:
- main
pull_request:
branches:
- main
- beta
merge_group:
types: [checks_requested]
jobs:
pages:
name: Github Pages
if: github.repository == 'pagefaultgames/pokerogue'
runs-on: ubuntu-latest
env:
api-dir: ./
strategy:
fail-fast: false
steps:
- name: Checkout repository for Typedoc
uses: actions/checkout@v4
with:
submodules: 'recursive'
path: pokerogue_docs
- name: Install OS package
run: |
sudo apt update
sudo apt install -y git openssh-client
- name: Setup Node 22.14.1
uses: actions/setup-node@v4
with:
node-version: 22
- name: Checkout repository for Github Pages
if: github.event_name == 'push'
uses: actions/checkout@v4
with:
path: pokerogue_gh
ref: gh-pages
- name: Install Node.js dependencies
working-directory: ${{env.api-dir}}
run: |
cd pokerogue_docs
npm ci
- name: Generate Typedoc docs
working-directory: ${{env.api-dir}}
run: |
cd pokerogue_docs
npm run docs -- --out /tmp/docs --githubPages false --entryPoints ./src/
- name: Commit & Push docs
if: github.event_name == 'push'
run: |
cd pokerogue_gh
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
mkdir -p $GITHUB_REF_NAME
rm -rf $GITHUB_REF_NAME/*
cp -r /tmp/docs/. $GITHUB_REF_NAME
git add $GITHUB_REF_NAME
git commit --allow-empty -m "[skip ci] Deploy docs"
git push