-
Notifications
You must be signed in to change notification settings - Fork 1.6k
127 lines (96 loc) · 4.19 KB
/
publish-github-pages.yaml
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
123
124
125
126
127
name: Publish GitHub Pages
on:
push:
branches:
- main
paths:
- .github/workflows/publish-github-pages.yaml
- samples/**
workflow_dispatch: {}
defaults:
run:
shell: bash
env:
node-version: 22
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checking out for ${{ github.ref }}
uses: actions/checkout@v4
- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.node-version }}
cache: npm
- run: npm clean-install
working-directory: ./samples
- name: Run npm run build
env:
NODE_ENV: production
run: npm run build
working-directory: ./samples
- name: Copy files
run: |
mkdir gh-pages
rsync -av --progress samples/index.css gh-pages/
rsync -av --progress samples/index.html gh-pages/
rsync -av --progress samples/README.md gh-pages/
mkdir gh-pages/00.migration
rsync -av --progress samples/00.migration/ gh-pages/00.migration/
mkdir gh-pages/01.getting-started
rsync -av --progress samples/01.getting-started/ gh-pages/01.getting-started/
mkdir gh-pages/02.branding-styling-and-customization
rsync -av --progress samples/02.branding-styling-and-customization/ gh-pages/02.branding-styling-and-customization/
mkdir gh-pages/03.speech
rsync -av --progress samples/03.speech/ gh-pages/03.speech/
mkdir gh-pages/04.api
rsync -av --progress samples/04.api/ gh-pages/04.api/ \
--exclude e.piping-to-redux \
--exclude f.selectable-activity \
--exclude g.chat-send-history \
--exclude h.clear-after-idle
mkdir gh-pages/04.api/e.piping-to-redux
rsync -av --progress samples/04.api/e.piping-to-redux/public/ gh-pages/04.api/e.piping-to-redux/
mkdir gh-pages/04.api/f.selectable-activity
rsync -av --progress samples/04.api/f.selectable-activity/public/ gh-pages/04.api/f.selectable-activity/
mkdir gh-pages/04.api/g.chat-send-history
rsync -av --progress samples/04.api/g.chat-send-history/public/ gh-pages/04.api/g.chat-send-history/
mkdir gh-pages/04.api/h.clear-after-idle
rsync -av --progress samples/04.api/h.clear-after-idle/public/ gh-pages/04.api/h.clear-after-idle/
mkdir gh-pages/05.custom-components
rsync -av --progress samples/05.custom-components/ gh-pages/05.custom-components/
mkdir gh-pages/06.recomposing-ui
rsync -av --progress samples/06.recomposing-ui/ gh-pages/06.recomposing-ui/ \
--exclude a.minimizable-web-chat \
--exclude b.speech-ui \
--exclude c.smart-display \
--exclude d.plain-ui \
--exclude e.extending-ui
mkdir gh-pages/06.recomposing-ui/a.minimizable-web-chat
rsync -av --progress samples/06.recomposing-ui/a.minimizable-web-chat/public/ gh-pages/06.recomposing-ui/a.minimizable-web-chat/
mkdir gh-pages/06.recomposing-ui/b.speech-ui
rsync -av --progress samples/06.recomposing-ui/b.speech-ui/public/ gh-pages/06.recomposing-ui/b.speech-ui/
mkdir gh-pages/06.recomposing-ui/c.smart-display
rsync -av --progress samples/06.recomposing-ui/c.smart-display/public/ gh-pages/06.recomposing-ui/c.smart-display/
mkdir gh-pages/06.recomposing-ui/d.plain-ui
rsync -av --progress samples/06.recomposing-ui/d.plain-ui/public/ gh-pages/06.recomposing-ui/d.plain-ui/
mkdir gh-pages/06.recomposing-ui/e.extending-ui
rsync -av --progress samples/06.recomposing-ui/e.extending-ui/public/ gh-pages/06.recomposing-ui/e.extending-ui/
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: gh-pages
release:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
id-token: write
pages: write
needs: build
runs-on: ubuntu-latest
steps:
- id: deployment
name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4