-
-
Notifications
You must be signed in to change notification settings - Fork 1
28 lines (26 loc) · 975 Bytes
/
sqlite-dump.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
name: SQLite Dump
on:
workflow_dispatch:
push:
jobs:
sqlitedump:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Dump the SQLite to a SQL File
run: for i in ./db/*.db; do sqlite3 $i .dump > $i.sql; done
- name: Dump the SQLite to CSV
run: for i in ./db/*.db; do sqlite3 -header -csv $i "select * from Quotes order by id Asc;" > $i.csv; done
- name: Count the quotes and write it to a YAML file
run: |
cd ./db; COUNT=$(sqlite3 quotes.db "Select Count(*) from Quotes"); echo "count: $COUNT" > quotes.count.yml
- name: Commit the SQLite dumps
uses: stefanzweifel/git-auto-commit-action@1f4914882d31162256a5dd23dd006bf97be303a2
with:
commit_message: SQLite database dump
file_pattern: db/*.db.* db/*.yml
- name: Notify if the code is broken
uses: sarisia/actions-status-discord@v1
if: failure()
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}