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: | |
fetch-depth: 0 | |
- 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 schema dependencies | |
run: npm install | |
working-directory: ./ | |
- name: Install dependencies | |
run: npm install | |
working-directory: ./docusaurus | |
- name: List schemas directory | |
run: ls -l src/schemas | |
- name: Generate schema documentation | |
run: npm run gendocs | |
working-directory: ./docusaurus | |
- name: List markdown directory | |
run: tree ./docusaurus/docs/ | |
- 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 |