-
Notifications
You must be signed in to change notification settings - Fork 71
154 lines (130 loc) · 4.27 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
name: Deploy
on:
push:
branches: [master]
schedule:
- cron: "45 5 * * *"
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@v4
with:
ref: master
# 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@v4
with:
node-version: 20.x
# Temporarily disabled
# - uses: actions/cache@v4
# with:
# path: |
# .cache
# .next/cache
# docs/compiled
# key: ${{ runner.os }}-build-${{ github.sha }}
# restore-keys: |
# ${{ runner.os }}-build-
- run: |
du -sh *
df -h / /mnt
- run: npm ci -f
# 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
# 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
- run: |
du -sh *
df -h / /mnt
# Temporarily move apidocs out of the way
- run: |
mkdir .apidocs_temp
mv public/docs/* .apidocs_temp
# Build website
- run: npm run build
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
- 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
- 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
- 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 -not -empty -print0 | xargs -0 -n1 -I '{}' sh -xc 'mkdir -p vertx-web-site.github.io/docs/$(basename {})/ && mv {}/* vertx-web-site.github.io/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@v4
with:
name: github-pages
path: website.tar
retention-days: 1
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4