You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.2 KiB
52 lines
1.2 KiB
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: schunter.doocs.org
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
if: github.repository == 'doocs/source-code-hunter'
|
|
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/source-code-hunter.git
|
|
destination-repo: git@gitee.com:Doocs/source-code-hunter.git |