-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
72 lines (62 loc) · 1.74 KB
/
github-pages.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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@v3
with:
submodules: 'recursive'
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
if: github.event_name == 'push'
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
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