-
Notifications
You must be signed in to change notification settings - Fork 26
57 lines (48 loc) · 1.55 KB
/
db.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
name: Database Sync
on:
workflow_dispatch:
push:
branches: [main]
paths:
- "domains/**"
- "dbgen.js"
- ".github/workflows/db.yml"
jobs:
generate:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install dependencies
run: npm install
- name: Generate database
run: node dbgen.js > database.json
- name: Upload database artifact
uses: actions/upload-artifact@v2
with:
name: database
path: database.json
upload:
needs: generate
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Download database artifact
uses: actions/download-artifact@v2
with:
name: database
path: database.json
- name: Commit and push database.json
run: |
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com'
git add database.json
git commit -m 'Update database.json'
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}