From d69fb7ca9e15a762787ab6b8e768b6408d61759f Mon Sep 17 00:00:00 2001 From: Nemo Date: Thu, 14 Mar 2024 18:48:28 +0530 Subject: [PATCH] make db --- .github/workflows/update.yml | 21 ++++++++++++++++++--- .gitignore | 3 ++- Makefile | 5 ++++- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 5a6554a7..935b4638 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -21,16 +21,21 @@ jobs: with: format: YYYY-ww - name: Cache File - uses: actions/cache@v3 + uses: actions/cache@v4 with: # Use current week number as cache path: .cache.pkl key: "cache-${{ steps.current-time.outputs.formattedTime }}" + - name: Cache File + uses: actions/cache@v3 + with: + path: /home/runner/.cache/event-fetcher-cache.sqlite + key: "cache-requests-${{ steps.current-time.outputs.formattedTime }}" - uses: actions/checkout@v4 name: Clone self repository with: ref: ${{ github.head_ref }} - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: '3.11' - name: Setup @@ -39,12 +44,22 @@ jobs: git config --global extensions.partialClone true pip install -r requirements.txt - name: Fetch updates - run: rm out/* && make all + run: rm out/* && make all && make db - uses: stefanzweifel/git-auto-commit-action@v5 name: Commit with: commit_message: Daily Updates commit_author: 'github-actions[bot] ' add_options: "--ignore-removal --update" + file_pattern: "out/*" + status_options: '--untracked-files=no' env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} +# Put the events.db in the artifacts + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: events.db + path: events.db + if-no-files-found: error + retention-days: 90 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 8cd43d2c..2a5bf6cd 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ _site .jekyll-metadata vendor tmp.py -tmp \ No newline at end of file +tmp +events.db \ No newline at end of file diff --git a/Makefile b/Makefile index b8587597..8f7ef182 100644 --- a/Makefile +++ b/Makefile @@ -62,4 +62,7 @@ out/bic.json: python src/ics-to-event.py out/bic.ics out/bic.json all: out/allevents.txt out/highape.txt out/mapindia.json out/bic.ics out/insider.txt out/bengalurusustainabilityforum.json out/bhaagoindia.txt out/scigalleryblr.json out/mmb.txt out/venn.json out/zomato.json out/urbanaut.json out/champaca.json out/atta_galatta.json out/bic.json - @echo "Done" \ No newline at end of file + @echo "Done" + +db: + python src/event-fetcher.py \ No newline at end of file