-
-
Notifications
You must be signed in to change notification settings - Fork 160
112 lines (96 loc) · 2.99 KB
/
static.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
name: Deploy Static Files
on:
push:
branches:
- main
jobs:
docs:
uses: pmndrs/docs/.github/workflows/build.yml@v2
with:
mdx: 'docs'
libname: 'xr'
base_path: '/xr/docs'
icon: '🤳'
github: 'https://github.com/pmndrs/xr'
home_redirect: '/getting-started/introduction'
examples:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: true
# Examples
- name: Building Examples
run: |
pnpm -r build
- name: Copy Examples
run: |
mkdir -p public/examples/minecraft
mkdir -p public/examples/pingpong
mkdir -p public/examples/rag-doll
mkdir -p public/examples/stage
mkdir -p public/examples/watch
mkdir -p public/examples/room-with-shadows
mkdir -p public/examples/layers
mkdir -p public/examples/secondary-input-sources
cp -r ./examples/minecraft/dist/* ./public/examples/minecraft
cp -r ./examples/pingpong/dist/* ./public/examples/pingpong
cp -r ./examples/rag-doll/dist/* ./public/examples/rag-doll
cp -r ./examples/stage/dist/* ./public/examples/stage
cp -r ./examples/watch/dist/* ./public/examples/watch
cp -r ./examples/room-with-shadows/dist/* ./public/examples/room-with-shadows
cp -r ./examples/layers/dist/* ./public/examples/layers
cp -r ./examples/secondary-input-sources/dist/* ./public/examples/secondary-input-sources
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: examples
path: public/examples/
bundle-artifacts:
runs-on: ubuntu-latest
needs:
- docs
- examples
steps:
- name: Download Examples Artifiact
uses: actions/download-artifact@v4
with:
name: examples
path: ./examples
- name: Download Docs Artifiact
uses: actions/download-artifact@v4
with:
name: github-pages
path: ./docs
- name: Extract Docs
run: tar -xf ./docs/artifact.tar -C ./docs/
- name: Create deploy.tar
run: tar -cf deploy.tar ./*
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: deploy
path: ./deploy.tar
deploy:
needs: bundle-artifacts
runs-on: ubuntu-latest
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4
with:
artifact_name: deploy