-
Notifications
You must be signed in to change notification settings - Fork 3
122 lines (102 loc) · 3.39 KB
/
website.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages
on:
# Runs on pushes targeting the default branch
push:
branches:
- main
paths:
- 'python/**'
- '.github/workflows/website.yml'
- 'website/**'
- 'unity/**'
# Alternative: only build for tags.
# tags:
# - '*'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# security: restrict permissions for CI jobs.
permissions:
contents: read
jobs:
build-client-docs-as-artifact:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install docfx
run: dotnet tool install -g docfx
- name: Run script to build the documentation
working-directory: ./unity/Documentation
run: ./scripts/build.cmd
# - name: Move docs to website directory
# run: |
# mkdir -p ./website/docs/client/
# cp -r ./unity/Documentation/clientHTMLOutput/* ./website/docs/client/
# Upload the website directory as an artifact
- uses: actions/upload-artifact@v4
with:
name: client-docs
path: ./unity/Documentation/clientHTMLOutput
build-server-docs:
needs: build-client-docs-as-artifact
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.10.12'
- name: Install Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: '1.8.3'
- name: Setup a local virtual environment (if no poetry.toml file)
working-directory: ./python
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- name: Define a cache for the virtual environment based on the dependencies lock file
uses: actions/cache@v3
with:
path: ./python/.venv
key: venv-${{ hashFiles('./python/poetry.lock') }}
- name: Install docs dependencies
working-directory: ./python
run: poetry install --with docs
- name: Build the documentation
working-directory: ./python
run: poetry run python tools/make_docs_cli.py
- name: Move docs to website directory
run: |
mkdir -p ./website/docs/server/
cp -r ./python/docs/* ./website/docs/server/
# Get client docs to use as part of pages artifact
- uses: actions/download-artifact@v4
with:
name: client-docs
path: ./website/docs/client
# # cleanup client docs artifacts
# - name: Delete client docs artifact
# run: |
# github.rest.actions.deleteArtifact({
# owner: context.repo.owner,
# repo: context.repo.repo,
# artifact_id: ${{ steps.artifact-download.outputs.artifact-id }}
# });
- uses: actions/upload-pages-artifact@v3
with:
path: ./website
# Single deploy job since we're just deploying
deploy:
needs: build-server-docs
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4