-
Notifications
You must be signed in to change notification settings - Fork 36
78 lines (66 loc) · 1.96 KB
/
generator.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Generator
on:
push:
branches: [ main ]
workflow_dispatch:
# One generator at a time
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Cache node_modules
uses: actions/cache@v3
id: cache
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-node-
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install --production --frozen-lockfile
- name: Build
run: yarn build
- name: Deploy to GitHub branch
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: dist
- name: Deploy to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: our-data
directory: dist
- name: Check for document changes, ignoring comments
uses: dorny/paths-filter@v2
id: changes
with:
filters: |
src:
- 'people/**/*[^.json]'
- name: Trigger web repackage
uses: actions/github-script@v6
if: steps.changes.outputs.src == 'true'
with:
github-token: ${{ secrets.GH_PERSONAL_TOKEN }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'one-among-us',
repo: 'web',
workflow_id: 'package.yml',
ref: 'main'
})