Skip to content

Manual Deploy And Upload To OSS #537

Manual Deploy And Upload To OSS

Manual Deploy And Upload To OSS #537

name: Manual Deploy And Upload To OSS
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: 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: 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/
cp worker.js ./build/
ls build
export DORIS_COMMIT=`git rev-parse HEAD`
- 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: Deploy Website
if: ${{ github.event.inputs.branch == 'master' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ github.token }}
publish_branch: asf-site
force_orphan: true
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: ${{ github.token }}
publish_branch: asf-site
force_orphan: true
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 }}'