forked from apache/doris-website
-
Notifications
You must be signed in to change notification settings - Fork 0
146 lines (136 loc) · 8.23 KB
/
cron-deploy-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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: Cron Deploy
on:
schedule:
- cron: '0 4,10,17 * * *' # UTC time
permissions: write-all
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: Production
steps:
- name: Checkout
uses: actions/checkout@master
with:
persist-credentials: false
submodules: recursive
- name: Add Chinese Fonts
run: |
sudo apt-get install ttf-mscorefonts-installer
sudo apt-get install fontconfig
fc-list :lang=zh
ls -lh /usr/share/fonts/
cp -rf ./static/fonts/* /usr/share/fonts/
mkfontscale
mkfontdir
fc-cache
fc-list :lang=zh
- name: clone common docs to versioned_docs
run: |
cp -rf benchmark versioned_docs/version-3.0
cp -rf ecosystem versioned_docs/version-3.0
cp -rf faq versioned_docs/version-3.0
cp -rf releasenotes versioned_docs/version-3.0
cp -rf gettingStarted versioned_docs/version-3.0
cp -rf benchmark versioned_docs/version-2.1
cp -rf ecosystem versioned_docs/version-2.1
cp -rf faq versioned_docs/version-2.1
cp -rf releasenotes versioned_docs/version-2.1
cp -rf gettingStarted versioned_docs/version-2.1
cp -rf benchmark versioned_docs/version-2.0
cp -rf ecosystem versioned_docs/version-2.0
cp -rf faq versioned_docs/version-2.0
cp -rf releasenotes versioned_docs/version-2.0
cp -rf gettingStarted versioned_docs/version-2.0
cp -rf benchmark versioned_docs/version-1.2
cp -rf ecosystem versioned_docs/version-1.2
cp -rf faq versioned_docs/version-1.2
cp -rf releasenotes versioned_docs/version-1.2
cp -rf gettingStarted versioned_docs/version-1.2
cp -rf benchmark docs
cp -rf ecosystem docs
cp -rf faq docs
cp -rf releasenotes docs
cp -rf gettingStarted docs
cp -rf common_docs_zh/benchmark i18n/zh-CN/docusaurus-plugin-content-docs/current
cp -rf common_docs_zh/ecosystem i18n/zh-CN/docusaurus-plugin-content-docs/current
cp -rf common_docs_zh/faq i18n/zh-CN/docusaurus-plugin-content-docs/current
cp -rf common_docs_zh/releasenotes i18n/zh-CN/docusaurus-plugin-content-docs/current
cp -rf common_docs_zh/gettingStarted i18n/zh-CN/docusaurus-plugin-content-docs/current
cp -rf common_docs_zh/benchmark i18n/zh-CN/docusaurus-plugin-content-docs/version-1.2
cp -rf common_docs_zh/ecosystem i18n/zh-CN/docusaurus-plugin-content-docs/version-1.2
cp -rf common_docs_zh/faq i18n/zh-CN/docusaurus-plugin-content-docs/version-1.2
cp -rf common_docs_zh/releasenotes i18n/zh-CN/docusaurus-plugin-content-docs/version-1.2
cp -rf common_docs_zh/gettingStarted i18n/zh-CN/docusaurus-plugin-content-docs/version-1.2
cp -rf common_docs_zh/benchmark i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0
cp -rf common_docs_zh/ecosystem i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0
cp -rf common_docs_zh/faq i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0
cp -rf common_docs_zh/releasenotes i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0
cp -rf common_docs_zh/gettingStarted i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0
cp -rf common_docs_zh/benchmark i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1
cp -rf common_docs_zh/ecosystem i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1
cp -rf common_docs_zh/faq i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1
cp -rf common_docs_zh/releasenotes i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1
cp -rf common_docs_zh/gettingStarted i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1
cp -rf common_docs_zh/benchmark i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0
cp -rf common_docs_zh/ecosystem i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0
cp -rf common_docs_zh/faq i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0
cp -rf common_docs_zh/releasenotes i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0
cp -rf common_docs_zh/gettingStarted i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Build
run: |
npm install -g yarn
yarn cache clean
export NODE_OPTIONS=--max-old-space-size=8192
yarn && yarn build
touch build/.dummy
cp .asf-site.yaml ./build/.asf.yaml
cp versions.json ./build/
ls build
export DORIS_COMMIT=`git rev-parse HEAD`
# - name: Generate PDF
# run: |
# npx vitpress-generate-pdf --initialDocURLs="https://doris.apache.org/docs/dev/get-starting/" --paginationSelector=".pagination-nav__link--next" --contentSelector="article" --coverImage="https://cdn.selectdb.com/static/doris_logo_512_4903556647.png" --coverTitle="Apache Doris Docs (English)" --outputPDFFilename="Apache Doris Docs (English).pdf" --tocOnlyH1=true
# npx vitpress-generate-pdf --initialDocURLs="https://doris.apache.org/zh-CN/docs/dev/get-starting/" --paginationSelector=".pagination-nav__link--next" --contentSelector="article" --coverImage="https://cdn.selectdb.com/static/doris_logo_512_4903556647.png" --coverTitle="Apache Doris Docs (中文)" --outputPDFFilename="Apache Doris Docs (中文).pdf" --tocOnlyH1=true
# mkdir -p ./build/assets/files/
# cp *.pdf ./build/assets/files/
# ls ./build/assets/files/
- name: Upload files to OSS
uses: ./.github/actions/aliyun-oss-website-action
with:
accessKeyId: ${{ secrets.ALIYUN_ACCESS_KEY_ID }}
accessKeySecret: ${{ secrets.ALIYUN_ACCESS_KEY_SECRET }}
bucket: ${{ secrets.ALIYUN_OSS_BUCKET }}
# use your own endpoint
endpoint: ${{ secrets.ALIYUN_OSS_ENDPOINT }}
folder: build
onlyUpload: true
- name: Remove pdf
run: rm -rf ./build/assets/files/*.pdf
- name: Deploy Website
if: ${{ github.event.inputs.branch == 'master' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ github.token }}
publish_branch: asf-site
publish_dir: ./build
force_orphan: true
destination_dir: ./
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: 'Automated deployment with doris branch ${{ github.event.inputs.branch }}@${{ env.DORIS_COMMIT }}'
- name: Deploy Branch
if: ${{ github.event.inputs.branch != 'master' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: asf-site
publish_dir: ./build
force_orphan: true
destination_dir: ${{ github.event.inputs.branch }}
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: 'Automated deployment with doris branch ${{ github.event.inputs.branch }}@${{ env.DORIS_COMMIT }}'