-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (58 loc) · 2.08 KB
/
app-shell-sync.yml
File metadata and controls
68 lines (58 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Update App Shell docs
on:
schedule:
- cron: "0 0 * * *" # Runs at 00:00 UTC every day
workflow_dispatch: # Allows manual triggering
jobs:
update-app-shell-pages:
runs-on: ubuntu-slim
env:
APP_SHELL_REF: main
steps:
- name: Generate app token
id: app-token
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2.2.2
with:
app-id: ${{ secrets.TAILOR_DOCS_BOT_APP_ID }}
private-key: ${{ secrets.TAILOR_DOCS_BOT_PRIVATE_KEY }}
- name: Checkout current repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
token: ${{ steps.app-token.outputs.token }}
ref: main
path: docs
- name: Checkout app-shell repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: tailor-platform/app-shell
ref: ${{ env.APP_SHELL_REF }}
path: app-shell
- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "24"
- name: Install dependencies for docs-sync script
working-directory: docs/scripts/docs-sync
run: npm ci
- name: Sync the docs files
working-directory: docs/scripts/docs-sync
run: npm start -- app-shell
- name: Check for changes
working-directory: docs
id: git_diff
run: |
git config --global --add safe.directory $PWD
git add -A
if git diff --staged --quiet; then
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Commit and push changes
if: steps.git_diff.outputs.changed == 'true'
working-directory: docs
run: |
git config user.name "tailor-docs-bot[bot]"
git config user.email "tailor-docs-bot[bot]@users.noreply.github.com"
git commit -m "Update App Shell pages"
git push origin main