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 10, 2024
1 parent ae47d68 commit ced5ac9
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 10 deletions.
34 changes: 26 additions & 8 deletions .github/workflows/jsdoc-to-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [ "dev" ]

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

strategy:
Expand All @@ -16,9 +16,9 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v4.1.5
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
uses: actions/setup-node@v4.0.2
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
Expand All @@ -28,9 +28,27 @@ jobs:
run: npm run build --if-present
- name: Generate JSDoc
run: npm run docs
- name: Deploy to GitHub Pages
uses: JamesIves/[email protected]

deploy:
needs: build

runs-on: ubuntu-latest

steps:
- name: Deploy to gh-pages # Deploy documentation to gh-pages branch
uses: actions/[email protected]
with:
token: ${{ secrets.GH_PAGES_TOKEN }}
branch: gh-pages # The branch the action should deploy to.
folder: public
ref: gh-pages
repository: ${{ github.repository }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Clear existing content (optional)
run: rm -rf ./public # This will remove all existing files in the gh-pages branch
- name: Copy docs to gh-pages
run: cp -r ./public/* . # Copy generated documentation to the branch
- name: Commit changes
run: |
git config user.name "darthcav"
git add .
git commit -m "Deploy JSDoc documentation"
- name: Push to gh-pages
run: git push origin gh-pages
4 changes: 2 additions & 2 deletions .github/workflows/test-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v4.1.5
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
uses: actions/setup-node@v4.0.2
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
Expand Down

0 comments on commit ced5ac9

Please sign in to comment.