2024-06-19 05:46:25 +08:00
|
|
|
name: Deploy to GitHub Pages
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- docs
|
2024-06-19 12:53:23 +08:00
|
|
|
- main
|
|
|
|
workflow_dispatch:
|
2024-06-19 05:46:25 +08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2024-06-19 12:53:23 +08:00
|
|
|
name: Generate docs
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
ref: docs
|
|
|
|
- name: Install Neovim
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
mkdir -p /tmp/nvim
|
|
|
|
wget -q https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage -O /tmp/nvim/nvim.appimage
|
|
|
|
cd /tmp/nvim
|
|
|
|
chmod a+x ./nvim.appimage
|
|
|
|
./nvim.appimage --appimage-extract
|
|
|
|
echo "/tmp/nvim/squashfs-root/usr/bin/" >> $GITHUB_PATH
|
|
|
|
- name: Generate docs
|
|
|
|
run: ./build.sh
|
2024-06-24 01:38:39 +08:00
|
|
|
- name: panvimdoc
|
|
|
|
uses: kdheepak/panvimdoc@main
|
|
|
|
with:
|
|
|
|
vimdoc: lazy.nvim
|
|
|
|
version: "Neovim >= 0.8.0"
|
|
|
|
description: "A modern plugin manager for Neovim"
|
2024-06-24 02:20:49 +08:00
|
|
|
pandoc: "README.vim.md"
|
2024-06-24 01:38:39 +08:00
|
|
|
demojify: false
|
|
|
|
treesitter: true
|
2024-06-19 12:53:23 +08:00
|
|
|
- name: Push changes
|
2024-06-23 16:19:14 +08:00
|
|
|
uses: stefanzweifel/git-auto-commit-action@v5
|
2024-06-19 12:53:23 +08:00
|
|
|
with:
|
|
|
|
commit_message: "chore(build): auto-generate docs"
|
|
|
|
commit_user_name: "github-actions[bot]"
|
|
|
|
commit_user_email: "github-actions[bot]@users.noreply.github.com"
|
|
|
|
commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
|
|
|
|
|
2024-06-24 02:35:17 +08:00
|
|
|
sync-docs:
|
2024-06-24 02:37:58 +08:00
|
|
|
needs: build
|
2024-06-24 02:35:17 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout docs branch
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
ref: docs
|
|
|
|
|
|
|
|
- name: Copy docs and README.md
|
|
|
|
run: |
|
2024-06-24 02:37:58 +08:00
|
|
|
mkdir -p /tmp/temp-docs
|
2024-06-24 02:39:17 +08:00
|
|
|
cp -r doc/ /tmp/temp-docs/
|
2024-06-24 02:37:58 +08:00
|
|
|
cp README.md /tmp/temp-docs/
|
2024-06-24 02:35:17 +08:00
|
|
|
|
|
|
|
- name: Checkout main branch
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
2024-06-24 23:15:44 +08:00
|
|
|
ref: main
|
2024-06-24 02:35:17 +08:00
|
|
|
|
|
|
|
- name: Copy to main branch
|
|
|
|
run: |
|
2024-06-24 02:37:58 +08:00
|
|
|
cp -r /tmp/temp-docs/doc/ .
|
|
|
|
cp /tmp/temp-docs/README.md .
|
2024-06-24 02:35:17 +08:00
|
|
|
|
2024-06-24 02:42:07 +08:00
|
|
|
- name: Push changes
|
|
|
|
uses: stefanzweifel/git-auto-commit-action@v5
|
|
|
|
with:
|
|
|
|
commit_message: "chore(build): auto-generate docs"
|
|
|
|
commit_user_name: "github-actions[bot]"
|
|
|
|
commit_user_email: "github-actions[bot]@users.noreply.github.com"
|
|
|
|
commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
|
2024-06-24 02:35:17 +08:00
|
|
|
|
2024-06-19 12:53:23 +08:00
|
|
|
docusaurus:
|
2024-06-19 05:46:25 +08:00
|
|
|
name: Build Docusaurus
|
2024-06-19 12:53:23 +08:00
|
|
|
needs: build
|
2024-06-19 05:46:25 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2024-06-19 12:53:23 +08:00
|
|
|
ref: docs
|
2024-06-19 05:48:27 +08:00
|
|
|
- uses: pnpm/action-setup@v4
|
2024-06-19 05:46:25 +08:00
|
|
|
- uses: actions/setup-node@v4
|
|
|
|
with:
|
|
|
|
node-version: 18
|
|
|
|
cache: pnpm
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Build website
|
|
|
|
run: pnpm build
|
|
|
|
|
|
|
|
- name: Upload Build Artifact
|
|
|
|
uses: actions/upload-pages-artifact@v3
|
|
|
|
with:
|
|
|
|
path: build
|
|
|
|
|
|
|
|
deploy:
|
|
|
|
name: Deploy to GitHub Pages
|
2024-06-19 12:53:23 +08:00
|
|
|
needs: docusaurus
|
2024-06-19 05:46:25 +08:00
|
|
|
|
|
|
|
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
|
|
|
|
permissions:
|
|
|
|
pages: write # to deploy to Pages
|
|
|
|
id-token: write # to verify the deployment originates from an appropriate source
|
|
|
|
|
|
|
|
# Deploy to the github-pages environment
|
|
|
|
environment:
|
|
|
|
name: github-pages
|
|
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Deploy to GitHub Pages
|
|
|
|
id: deployment
|
|
|
|
uses: actions/deploy-pages@v4
|