Skip to content

Commit

Permalink
feat: build and deploy docs to gh pages, #43
Browse files Browse the repository at this point in the history
  • Loading branch information
ciatph committed Sep 11, 2024
1 parent 5d30700 commit 4000ba4
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build and Deploy Docs

on:
push:
branches-ignore:
- master
- dev

jobs:
build-docs:
name: Install JSDoc Dependencies
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4

- name: Use NodeJS v16.14.2
uses: actions/setup-node@v3
with:
node-version: 16.14.2

- name: Install jsdoc and build
run: |
chmod u+x scripts/build-docs.sh
./scripts/build-docs.sh
- name: Archive Development Artifact
uses: actions/upload-artifact@v4
with:
name: out
path: out/ph-municipalities/${{ env.version }}
retention-days: 3

deploy-client:
name: Deploy client to Github Pages
needs: lint-client
runs-on: ubuntu-latest
steps:
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: out

- name: List files for publish
run: ls -l -a

- name: Deploy to Github Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./
publish_branch: gh-pages
17 changes: 17 additions & 0 deletions scripts/build-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

cd app

# Install jsdoc and theme
npm install --save-dev jsdoc minami taffydb

# Generate the documentation
npm run generate-docs

# Find and export the active version no.
filePath="app/package.json"
version=$(grep -oP '"version":\s*"\K[^"]+' "$filePath")

# Output the version as a GitHub Actions output variable
echo "$version" >> $GITHUB_ENV
echo version: "$version"

0 comments on commit 4000ba4

Please sign in to comment.