2024-05-31 14:36:59 +01:00
|
|
|
name: "Github Pages"
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2024-06-01 01:30:55 +01:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
2024-05-31 14:36:59 +01:00
|
|
|
|
|
|
|
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@v3
|
|
|
|
with:
|
|
|
|
path: pokerogue_docs
|
|
|
|
|
|
|
|
- name: Install OS package
|
|
|
|
run: |
|
|
|
|
sudo apt update
|
|
|
|
sudo apt install -y git openssh-client
|
|
|
|
|
|
|
|
- name: Setup Node 20.13.1
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 20
|
|
|
|
|
|
|
|
- name: Checkout repository for Github Pages
|
2024-06-01 01:30:55 +01:00
|
|
|
if: github.event_name == 'push'
|
2024-05-31 14:36:59 +01:00
|
|
|
uses: actions/checkout@v3
|
|
|
|
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
|
|
|
|
npx typedoc --out /tmp/docs --githubPages false --entryPoints ./src/
|
|
|
|
|
|
|
|
- name: Commit & Push docs
|
2024-06-01 01:30:55 +01:00
|
|
|
if: github.event_name == 'push'
|
2024-05-31 14:36:59 +01:00
|
|
|
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
|