docs: add api docs #17
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
name: Deploy to remote | |
on: [push, workflow_dispatch] | |
jobs: | |
build: | |
name: Build and Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true # Checkout private submodules(themes or something else). | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 'lts/*' | |
- name: Build | |
run: | | |
npm install | |
npm run docs:build | |
- name: Build API docs | |
run: | | |
cd dev/api | |
npm install | |
npm run op:build | |
npm run docs:build | |
cp -r .vitepress/dist/ ../../.vitepress/dist/api | |
cd ../../ | |
- name: Setup SSH | |
uses: webfactory/ssh-agent@v0.7.0 | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Add known host | |
run: | |
echo "${{ secrets.SSH_KNOWN_HOSTS }}" >> ~/.ssh/known_hosts | |
- name: Publish to remote | |
run: | | |
apt update && apt install rsync -y | |
rsync -av --delete -e "ssh -p ${{ secrets.SSH_PORT }}" .vitepress/dist/ ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:${{ secrets.WEB_ROOT }} |