Skip to content

Commit

Permalink
feat(docs): add initial documentation implementation using ng-doc
Browse files Browse the repository at this point in the history
  • Loading branch information
NetWin committed Oct 12, 2024
1 parent 037332b commit 83cd3d9
Show file tree
Hide file tree
Showing 28 changed files with 20,873 additions and 13,415 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Deploy docs to github-pages

on:
push:
branches:
- "master"
- "feature/ng-doc"

workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: "npm"

- name: Install dependencies
run: npm ci

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Run build (docs)
run: npx ng build docs --base-href /date-time-picker/

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'dist/docs/browser'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,7 @@ Thumbs.db

.angular
.cache
coverage
coverage

# NgDoc files
/ng-doc
34 changes: 25 additions & 9 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"newProjectRoot": "projects",
"projects": {
"date-time-picker-app": {
"docs": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
Expand All @@ -22,25 +22,41 @@
},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:application",
"builder": "@ng-doc/builder:application",
"options": {
"allowedCommonJsDependencies": [
"moment-timezone"
"@ng-doc/core"
],
"aot": true,
"outputPath": {
"base": "dist/date-time-picker-app"
"base": "dist/docs"
},
"index": "src/index.html",
"polyfills": [
"src/polyfills.ts"
],
"tsConfig": "src/tsconfig.app.json",
"assets": [
{
"glob": "**/*",
"input": "node_modules/@ng-doc/app/assets",
"output": "assets/ng-doc/app"
},
{
"glob": "**/*",
"input": "node_modules/@ng-doc/ui-kit/assets",
"output": "assets/ng-doc/ui-kit"
},
{
"glob": "**/*",
"input": "ng-doc/docs/assets",
"output": "assets/ng-doc"
},
"src/favicon.ico",
"src/assets"
],
"styles": [
"node_modules/@ng-doc/app/styles/global.css",
"src/styles.scss"
],
"scripts": [],
Expand Down Expand Up @@ -89,25 +105,25 @@
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"builder": "@ng-doc/builder:dev-server",
"options": {
"buildTarget": "date-time-picker-app:build",
"buildTarget": "docs:build",
"port": 4201
},
"configurations": {
"production": {
"buildTarget": "date-time-picker-app:build:production"
"buildTarget": "docs:build:production"
},
"development": {
"buildTarget": "date-time-picker-app:build:development"
"buildTarget": "docs:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"buildTarget": "date-time-picker-app:build"
"buildTarget": "docs:build"
}
},
"lint": {
Expand Down
Loading

0 comments on commit 83cd3d9

Please sign in to comment.