Ver código fonte

added github action for updating database

sirekanian 3 anos atrás
pai
commit
4eebb80b02
2 arquivos alterados com 20 adições e 1 exclusões
  1. 18 0
      .github/workflows/update.yml
  2. 2 1
      update.sh

+ 18 - 0
.github/workflows/update.yml

@@ -0,0 +1,18 @@
+on:
+  push:
+  workflow_dispatch:
+  schedule:
+    - cron: '30 0 * * *'
+permissions:
+  contents: write
+jobs:
+  update:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v3
+      - shell: bash
+        run: |
+          git config user.name sirekanian
+          git config user.email sirekanian@pm.me
+          ./update.sh
+          git push

+ 2 - 1
update.sh

@@ -1,6 +1,7 @@
 #!/usr/bin/env bash
 
 set -e
+set -o pipefail
 
 ENDPOINT="https://sirekanian.github.io/warmongr"
 SCHEMAS="app/schemas/com.sirekanian.acf.data.local.Database"
@@ -52,4 +53,4 @@ sqlite3 app/src/main/assets/warmongers.db <app/schemas/init.sql
 # commit changes
 git add app/schemas/*.csv
 git add app/src/main/assets/warmongers.db
-git commit -m "updated pre-packaged database"
+git commit -m "updated pre-packaged database" || true