mirror of
https://github.com/doocs/advanced-java.git
synced 2026-08-18 10:43:29 +08:00
52 lines
1.2 KiB
YAML
52 lines
1.2 KiB
YAML
name: Build and deploy
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
docs:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
cache: npm
|
|
|
|
- name: Setup Pages
|
|
uses: actions/configure-pages@v4
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Build with VitePress
|
|
run: npm run docs:build
|
|
|
|
- name: Deploy to GitHub Pages
|
|
uses: crazy-max/ghaction-github-pages@v4
|
|
with:
|
|
target_branch: gh-pages
|
|
build_dir: docs/.vitepress/dist
|
|
fqdn: java.doocs.org
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
if: github.repository == 'doocs/advanced-java'
|
|
needs: docs
|
|
steps:
|
|
- name: Sync to Gitee
|
|
uses: wearerequired/git-mirror-action@master
|
|
env:
|
|
SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }}
|
|
with:
|
|
source-repo: git@github.com:doocs/advanced-java.git
|
|
destination-repo: git@gitee.com:Doocs/advanced-java.git |