Skip to content

Commit

Permalink
chore(github-ci): setup deploy docs on github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
pandres95 committed Mar 10, 2024
1 parent e737ed4 commit ba2bc7e
Show file tree
Hide file tree
Showing 7 changed files with 165 additions and 4 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build and Deploy Docs

on:
push:
branches: [main]

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: |
npm ci
npm run -w libs/protocol docs
mkdir docs
mv libs/protocol/docs docs/protocol
- name: Fix permissions
run: |
chmod -c -R +rX "docs/" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs

# Deploy job
deploy:
# Add a dependency to the build job
needs: build

# 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 }}

# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist
node_modules
.env
.env
docs/
1 change: 1 addition & 0 deletions libs/protocol/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"license": "MIT",
"scripts": {
"build": "tsc",
"docs": "typedoc",
"prepack": "npm run build"
},
"types": "src/index.ts",
Expand Down
1 change: 1 addition & 0 deletions libs/protocol/typedoc.json
106 changes: 103 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"devDependencies": {
"@tsconfig/node-lts": "^20.1.0",
"ts-node": "^10.9.2",
"typedoc": "^0.25.12",
"typescript": "^5.3.3"
},
"dependencies": {
Expand Down
7 changes: 7 additions & 0 deletions typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
// Comments are supported, like tsconfig.json
"entryPoints": [
"src/index.ts"
],
"out": "docs"
}

0 comments on commit ba2bc7e

Please sign in to comment.