Update DB #12042
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 <[email protected]> | |
- 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 <[email protected]> | |
branch: gh-pages |