-
Notifications
You must be signed in to change notification settings - Fork 10
58 lines (48 loc) · 1.4 KB
/
update-dist.yml
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
on:
workflow_dispatch:
push:
branches:
- master
paths:
- "*/*.json"
name: Dist. Branch Update
jobs:
update:
name: Update
runs-on: ubuntu-latest
steps:
- name: Checkout ScratchAddons/Website
uses: actions/checkout@v4
- name: Checkout ScratchAddons/schema-dist-updater
uses: actions/checkout@v4
with:
repository: ScratchAddons/schema-dist-updater
path: script
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: Install dependencies
run: npm install --prefix script
- name: Create branch folder
run: node script/index.js
- name: Generate token
uses: tibdex/github-app-token@v2
id: generate-token
with:
app_id: ${{ secrets.BOT_APP_ID }}
private_key: ${{ secrets.BOT_PRIVATE_KEY }}
- name: Update branch with the folder
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ steps.generate-token.outputs.token }}
publish_dir: dist
force_orphan: true
publish_branch: dist
enable_jekyll: true