File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Sync Editor on Editor Release
2+
3+ on :
4+ repository_dispatch :
5+ types : [editor-release]
6+
7+ permissions :
8+ contents : write
9+
10+ jobs :
11+ sync :
12+ name : Rebuild admin UI with updated editor
13+ runs-on : ubuntu-latest
14+ steps :
15+ - uses : actions/checkout@v4
16+
17+ - uses : actions/setup-node@v4
18+ with :
19+ node-version : ' 22'
20+ registry-url : ' https://npm.pkg.github.com'
21+ scope : ' @gocodealone'
22+
23+ - name : Clone workflow repo and update editor package
24+ run : |
25+ EDITOR_VERSION="${{ github.event.client_payload.version }}"
26+ git clone --depth 1 https://github.com/GoCodeAlone/workflow.git /tmp/workflow-ui-build
27+ cd /tmp/workflow-ui-build/ui
28+ npm install "@gocodealone/workflow-editor@${EDITOR_VERSION#v}"
29+ env :
30+ NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
31+
32+ - name : Build admin UI
33+ run : |
34+ cd /tmp/workflow-ui-build/ui
35+ npm ci
36+ npx vite build
37+ env :
38+ NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
39+
40+ - name : Copy dist to repo
41+ run : |
42+ rm -rf internal/ui_dist
43+ cp -r /tmp/workflow-ui-build/ui/dist internal/ui_dist
44+ rm -rf /tmp/workflow-ui-build
45+
46+ - name : Commit and tag
47+ run : |
48+ EDITOR_VERSION="${{ github.event.client_payload.version }}"
49+ git config user.name "github-actions[bot]"
50+ git config user.email "github-actions[bot]@users.noreply.github.com"
51+ git add -A
52+ git diff --cached --quiet && echo "No changes" && exit 0
53+ git commit -m "chore: sync editor to ${EDITOR_VERSION}"
54+ git push
55+ git tag "${EDITOR_VERSION}"
56+ git push origin "${EDITOR_VERSION}"
You can’t perform that action at this time.
0 commit comments