-
Notifications
You must be signed in to change notification settings - Fork 71
194 lines (165 loc) · 5.63 KB
/
deploy.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
name: Deploy
on:
push:
branches: [ master, vertx5 ]
concurrency:
group: master-deploy
cancel-in-progress: true
permissions:
contents: read
# these permissions are required for the deploy-pages action to work properly
pages: write
id-token: write
jobs:
deploy:
runs-on: ubuntu-latest
environment:
# links this workflow to the deployments page on your repository
name: github-pages
# attaches the deployed URL to this job on the workflow summary
url: ${{ steps.deployment.outputs.page_url }}
steps:
# Delete tools not needed for the build process
# This saves about 4GB of disk space
- name: Delete unnecesary tools
run: |
df -h /
sudo rm -rf /usr/local/share/boost
sudo rm -rf $AGENT_TOOLSDIRECTORY
df -h /
# Checkout master
- uses: actions/checkout@v2
with:
ref: master
# Checkout vertx5 branch
- uses: actions/checkout@v2
with:
ref: vertx5
path: vertx5
# Remove more unnecessary tools. We should have about 52GB of free disk space after this.
# See https://github.com/apache/flink/blob/master/tools/azure-pipelines/free_disk_space.sh
# NOT NEEDED AT THE MOMENT - DISK SIZE IS LARGE ENOUGH
# RE-ENABLE LATER IF NECESSARY
# - name: Free up more disk space
# run: |
# .github/workflows/free_disk_space.sh
- name: Setup Node.js 20.x
uses: actions/setup-node@v1
with:
node-version: 20.x
- uses: actions/cache@v2
with:
path: |
.cache
.next/cache
docs/compiled
vertx5/docs/compiled
key: ${{ runner.os }}-build-${{ github.sha }}
restore-keys: |
${{ runner.os }}-build-
- run: |
du -sh *
df -h / /mnt
- run: npm ci -f
# Install dependencies for vertx5
- run: npm ci -f
working-directory: vertx5
# Necessary to generate OpenGraph images
- name: Install Chromium for Playwright
run: npx playwright install --with-deps chromium
# Download, extract, and compile docs
- run: npm run update-docs
- run: |
du -sh *
df -h / /mnt
# Compile vertx5 docs (only latest bugfix versions to save time and space)
- run: npm run update-docs -- --latest-bugfix-versions-only
working-directory: vertx5/docs
# Remove files that have been used while running 'update-docs' but that
# are not needed anymore for the remainder of the workflow. This is
# necessary to save disk space.
- name: Cleanup temporary files
run: |
rm -rf docs/download
rm -rf docs/extracted
rm -rf docs/node_modules
rm -rf vertx5/docs/download
rm -rf vertx5/docs/extracted
rm -rf vertx5/docs/node_modules
- run: |
du -sh *
df -h / /mnt
# Temporarily move apidocs out of the way
- run: |
mkdir .apidocs_temp
mv public/docs/* .apidocs_temp
# Temporarily move apidocs out of the way (vertx5)
- run: |
mkdir .apidocs_temp
mv public/docs/* .apidocs_temp
working-directory: vertx5
# Build website
- run: npm run build
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
- run: |
du -sh *
df -h / /mnt
# Build vertx5 website
- run: |
cp -r .cache vertx5/.cache
mkdir -p vertx5/.next
cp -r .next/cache vertx5/.next/cache
- run: npm run build
env:
VERTX_WEBSITE_BASEPATH: vertx5
GITHUB_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
working-directory: vertx5
- run: |
du -sh *
df -h / /mnt
# Remove files that have been used during build but that are not needed
# anymore for the remainder of the workflow. This is necessary to save
# disk space.
- name: Cleanup temporary files
run: |
rm -rf node_modules
rm -rf vertx5/node_modules
- run: |
du -sh *
df -h / /mnt
- name: Prepare output directory
run: |
mkdir vertx-web-site.github.io
cd vertx-web-site.github.io
touch .nojekyll
echo vertx.io > CNAME
cd ..
- name: Copy build to output directory
run: |
shopt -s dotglob # include dot files
mv out/* vertx-web-site.github.io
mkdir vertx-web-site.github.io/vertx5
mv vertx5/out/* vertx-web-site.github.io/vertx5
- name: Copy API docs into output directory
run: |
mv .apidocs_temp/apidocs vertx-web-site.github.io/docs/
find .apidocs_temp -mindepth 1 -maxdepth 1 -type d -print0 | xargs -0 -n1 -I '{}' sh -xc 'mv {}/* vertx-web-site.github.io/docs/$(basename {})/'
mv vertx5/.apidocs_temp/apidocs vertx-web-site.github.io/vertx5/docs/
find vertx5/.apidocs_temp -mindepth 1 -maxdepth 1 -type d -print0 | xargs -0 -n1 -I '{}' sh -xc 'mv {}/* vertx-web-site.github.io/vertx5/docs/$(basename {})/'
- run: |
du -sh *
df -h / /mnt
- name: Create Archive
run: |
cd vertx-web-site.github.io
tar --dereference --hard-dereference -cf ../website.tar .
- name: Upload Archive
uses: actions/upload-artifact@v3
with:
name: github-pages
path: website.tar
retention-days: 1
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1