-
Notifications
You must be signed in to change notification settings - Fork 3
75 lines (62 loc) · 1.66 KB
/
update.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
name: "Update DB"
on:
schedule:
- cron: "38 * * * *"
workflow_dispatch:
inputs:
tags:
description: 'this checkbox does nothing'
required: false
type: boolean
jobs:
update:
name: Update
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Install NPM packages
working-directory: ./.server
run: npm ci
- name: Run update script
run: npm run db-update
working-directory: ./.server
- name: Commit to base branch
uses: stefanzweifel/git-auto-commit-action@v4
with:
file_pattern: './public/db/*.yaucsccs.zstd'
commit_message: Routine DB Update
commit_author: GitHub Actions Bot <actions@github.com>
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: database
path: ./public/db/*.yaucsccs.zstd
deploy:
name: Deploy
needs: update
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout branch
uses: actions/checkout@v2
with:
ref: gh-pages
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: database
path: ./db
- name: Commit to sub branch
uses: stefanzweifel/git-auto-commit-action@v4
with:
file_pattern: '*.yaucsccs.zstd'
commit_message: Routine DB Update
commit_author: GitHub Actions Bot <actions@github.com>
branch: gh-pages