Skip to content

Commit

Permalink
Improved gh actions
Browse files Browse the repository at this point in the history
  • Loading branch information
darthcav committed May 9, 2024
1 parent f9a5f19 commit 76eefd5
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 11 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/jsdoc-to-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish JSDoc documentation in Node.js app in GitHub Pages

on:
push:
branches: [ "dev" ]
pull_request:
branches: [ "dev" ]

jobs:
gh-pages:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [ 22.x ]

steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Optional build step
run: npm run build --if-present
- name: Generate JSDoc
run: npm run docs
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GH_PAGES_TOKEN }}
publish_dir: ./public # replace with your JSDoc output directory if different
16 changes: 10 additions & 6 deletions .github/workflows/nodejs.yml → .github/workflows/test-node.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI
name: Test Node.js app in CI

on:
push:
Expand All @@ -9,20 +9,24 @@ on:
branches: [ "dev" ]

jobs:
build:
test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [ 20.x, 22.x ]

steps:
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm ci
- run: npm run build --if-present
- run: npm test
- name: Install dependencies
run: npm ci
- name: Optional build step
run: npm run build --if-present
- name: Run tests
run: npm test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
node_modules/
jspm_packages/

# Documentation directory
public

# Logs
logs
*.log
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"imergo-logger": "8.5.0"
},
"devDependencies": {
"clean-jsdoc-theme": "4.2.18",
"clean-jsdoc-theme": "4.3.0",
"docdash": "2.0.2",
"jsdoc": "4.0.3"
},
Expand Down

0 comments on commit 76eefd5

Please sign in to comment.