fx: broken link #31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adapted from https://www.github.com/folke/lazy.nvim | |
name: Deploy to GitHub Pages | |
on: | |
push: | |
branches: | |
- docs | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
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 | |
# - name: panvimdoc | |
# uses: kdheepak/panvimdoc@main | |
# with: | |
# vimdoc: lazy.nvim | |
# version: "Neovim >= 0.8.0" | |
# description: "A modern plugin manager for Neovim" | |
# pandoc: "README.vim.md" | |
# demojify: false | |
# treesitter: true | |
# - 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>" | |
copy-docs: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout main branch | |
uses: actions/checkout@v4 | |
with: | |
ref: main | |
- name: Copy docs | |
run: | | |
mkdir -p /tmp/temp-docs | |
cp -r docs/ /tmp/temp-docs/ | |
- name: Checkout docs branch | |
uses: actions/checkout@v4 | |
with: | |
ref: docs | |
- name: Copy docs for building | |
run: | | |
rm -rf docs/* | |
cp -r /tmp/temp-docs/docs/* docs | |
ls docs | |
- 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>" | |
docusaurus: | |
name: Build Docusaurus | |
needs: copy-docs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: docs | |
- uses: pnpm/action-setup@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
cache: pnpm | |
- name: Debug | |
run: | | |
ls docs | |
- 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 | |
needs: docusaurus | |
# 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 |