2021-03-15 13:48:10 +08:00
|
|
|
name: Deploy Vuepress
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-03-15 13:48:56 +08:00
|
|
|
- main
|
2021-03-15 13:48:10 +08:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
2021-04-06 19:05:35 +08:00
|
|
|
fetch-depth: 0
|
2021-09-11 18:37:02 +08:00
|
|
|
- uses: actions/setup-node@v2
|
|
|
|
with:
|
2023-09-30 00:02:52 -04:00
|
|
|
node-version: "18"
|
2024-01-31 23:25:10 -05:00
|
|
|
- name: Install yarn and pnpm
|
2024-01-20 17:40:34 -05:00
|
|
|
run: |
|
2024-01-20 17:56:54 -05:00
|
|
|
npm install yarn@1.22.19 -g
|
2024-01-31 23:25:10 -05:00
|
|
|
npm install -g pnpm
|
2021-03-15 13:48:10 +08:00
|
|
|
- name: Get yarn cache directory path
|
|
|
|
id: yarn-cache-dir-path
|
2024-01-21 07:59:08 +08:00
|
|
|
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
|
2021-03-15 13:48:10 +08:00
|
|
|
- uses: actions/cache@v2
|
|
|
|
id: yarn-cache
|
|
|
|
with:
|
|
|
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-yarn-
|
|
|
|
- name: Install and Build
|
2021-09-15 18:28:06 +08:00
|
|
|
env:
|
|
|
|
XRAY_DOCS_USE_VITE: "true"
|
2023-02-27 07:59:12 +00:00
|
|
|
NODE_OPTIONS: "--max_old_space_size=4096"
|
2021-03-15 13:48:10 +08:00
|
|
|
run: |
|
2024-01-31 23:22:25 -05:00
|
|
|
pnpm install
|
2021-03-15 13:50:21 +08:00
|
|
|
yarn docs:build
|
2021-03-15 13:48:10 +08:00
|
|
|
- name: Deploy
|
|
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
publish_dir: docs/.vuepress/dist
|
2021-09-15 18:28:06 +08:00
|
|
|
- name: Build for Main Repository
|
|
|
|
env:
|
|
|
|
XRAY_DOCS_MAIN_REPO: "true"
|
2023-09-30 00:11:20 -04:00
|
|
|
NODE_OPTIONS: "--max_old_space_size=4096 --openssl-legacy-provider"
|
2021-09-15 18:28:06 +08:00
|
|
|
run: |
|
|
|
|
yarn docs:build
|
|
|
|
- name: Deploy to main Repository
|
|
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
|
|
with:
|
2021-09-15 18:46:20 +08:00
|
|
|
personal_token: ${{ secrets.ACTION_PERSONAL_TOKEN }}
|
2021-09-15 18:28:06 +08:00
|
|
|
publish_dir: docs/.vuepress/dist
|
|
|
|
external_repository: XTLS/XTLS.github.io
|
|
|
|
publish_branch: gh-pages-next
|