-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (61 loc) · 1.65 KB
/
build_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
58
59
60
61
62
name: Build USCIS DB
on:
schedule:
- cron: '30 4 * * *'
workflow_dispatch:
jobs:
build_db:
runs-on: ubuntu-latest
outputs:
dbname: ${{ steps.dbname.outputs.dbname }}
steps:
- uses: actions/checkout@v4
- name: Download previous DB
uses: robinraju/release-downloader@v1
with:
latest: true
fileName: '*.db'
out-file-path: 'prev'
- name: Build DB and changelog
run: ./build_db.sh
- name: Get DB name
id: dbname
run: echo ::set-output name=dbname::"$(basename *.db .db)"
- name: Upload DB
uses: actions/upload-artifact@v4
with:
name: uscis-db
path: '${{ steps.dbname.outputs.dbname }}.db'
if-no-files-found: error
- name: Upload changelog
uses: actions/upload-artifact@v4
with:
name: changelog
path: |
changelog.txt
sqldiff.txt
if-no-files-found: error
- name: Build JSON DB
if: always()
run: sqlite3 responses.db -A -c *.json
- name: Upload JSON DB
uses: actions/upload-artifact@v4
if: always()
with:
name: responses-db
path: 'responses.db'
if-no-files-found: error
publish_db:
runs-on: ubuntu-latest
needs: build_db
steps:
- name: Download DB
uses: actions/download-artifact@v4
- name: Create daily release
uses: softprops/action-gh-release@v2
with:
name: ${{ needs.build_db.outputs.dbname }}
tag_name: ${{ needs.build_db.outputs.dbname }}
body_path: 'changelog/changelog.txt'
files: 'uscis-db/*.db'
fail_on_unmatched_files: true