forked from apache/doris-website
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (76 loc) · 2.99 KB
/
manual-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
name: Manual Deploy
on:
workflow_dispatch:
inputs:
branch:
description: 'Specify the branch name'
required: true
default: 'master'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: Production
steps:
- name: Checkout
uses: actions/checkout@master
with:
persist-credentials: false
submodules: recursive
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 16.14.0
- name: Build
run: |
git clone https://github.com/apache/doris.git
mkdir versioned_docs/version-dev/
cp -R doris/docs/en/docs/* versioned_docs/version-dev/
cp -R doris/docs/sidebars.json versioned_sidebars/version-dev-sidebars.json
mkdir i18n/zh-CN/docusaurus-plugin-content-docs/version-dev
cp -R doris/docs/zh-CN/docs/* i18n/zh-CN/docusaurus-plugin-content-docs/version-dev/
cp -R doris/docs/dev.json i18n/zh-CN/docusaurus-plugin-content-docs/version-dev.json
mkdir -p community
cp -R doris/docs/en/community/* community/
mkdir -p i18n/zh-CN/docusaurus-plugin-content-docs-community/current/
cp -R doris/docs/zh-CN/community/* i18n/zh-CN/docusaurus-plugin-content-docs-community/current/
cp -R doris/docs/sidebarsCommunity.json .
cp -R doris/docs/images static/
npm install -g yarn
yarn cache clean
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: Upload files to OSS
uses: fangbinwei/aliyun-oss-website-action@dev
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
- 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
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
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 }}'