update: remove depth & set working dir for zod2md #19
Workflow file for this run
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: Generate Docs and Deploy Docusaurus | |
on: | |
push: | |
branches: | |
- main | |
- docusaurus | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: docusaurus | |
- name: Fetch schemas and package files from main | |
run: | | |
git fetch origin main | |
git checkout origin/main -- src/schemas src/errors package.json package-lock.json | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
- name: Install zod2md | |
run: npm install zod2md | |
working-directory: ./ | |
- name: Install schema dependencies | |
run: npm install | |
working-directory: ./ | |
- name: Install docusaurus dependencies | |
run: npm install | |
working-directory: ./docusaurus | |
- name: Generate schema documentation | |
run: npm run gendocs | |
working-directory: ./docusaurus | |
- name: Debug | |
run: | | |
tree src/schemas | |
tree ./docusaurus/docs/ | |
cat ./docusaurus/docs/sdo/asset.schema.md | |
- name: Build Docusaurus site | |
run: npm run build | |
working-directory: ./docusaurus | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
deploy_key: ${{ secrets.DEPLOY_KEY }} | |
publish_dir: ./docusaurus/build |