Skip to content

Commit e02dd64

Browse files
committed
rework workflows and setup dispatch job
1 parent d7e2534 commit e02dd64

3 files changed

Lines changed: 49 additions & 4 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: build
1+
name: Test if build is working
22

33
on:
44
pull_request:
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,16 @@ name: gh-pages
33

44
on:
55
push:
6-
branches: ["main"]
6+
branches:
7+
- main
78
paths-ignore:
9+
- '.github/workflows/build.yml'
10+
- '.github/workflows/update.yml'
11+
- '.gitignore'
12+
- 'jsdoc.json'
13+
- 'LICENSE'
814
- 'README.md'
15+
- 'renovate.json'
916

1017
# Allows you to run this workflow manually from the Actions tab
1118
workflow_dispatch:
@@ -23,7 +30,7 @@ concurrency:
2330
cancel-in-progress: false
2431

2532
jobs:
26-
deploy:
33+
run:
2734
environment:
2835
name: github-pages
2936
url: ${{ steps.deployment.outputs.page_url }}
@@ -36,7 +43,7 @@ jobs:
3643
- name: Upload artifact
3744
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3
3845
with:
39-
# Only upload the api docs folder
46+
# Only upload the code docs folder
4047
path: "docs"
4148
- name: Deploy to GitHub Pages
4249
id: deployment

.github/workflows/update.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Update code docs
2+
3+
on:
4+
repository_dispatch:
5+
types: [code-update]
6+
7+
jobs:
8+
run:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
12+
with:
13+
ref: ${{ github.ref_name }}
14+
token: ${{ secrets.JELLYROCK_BOT_TOKEN }}
15+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
16+
with:
17+
node-version: "lts/*"
18+
cache: "npm"
19+
- name: Install NPM dependencies
20+
run: npm ci
21+
- name: Checkout jellyrock
22+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
23+
with:
24+
repository: cewert/jellyrock
25+
path: jellyrock
26+
ref: main
27+
- name: Build code docs
28+
# TODO: fix jsdoc build errors then remove '|| true' from run command below
29+
run: npm run build || true
30+
- name: Commit any changes
31+
uses: stefanzweifel/git-auto-commit-action@778341af668090896ca464160c2def5d1d1a3eb0 # v6
32+
with:
33+
commit_message: Update code docs
34+
# use JellyRock-bot to commit the changes instead of the default github-actions[bot]
35+
commit_user_name: JellyRock-bot
36+
commit_user_email: c.ewert@gmail.com
37+
# use JellyRock-bot to author the changes instead of the default author of the merge commit
38+
commit_author: JellyRock-bot <c.ewert@gmail.com>

0 commit comments

Comments
 (0)