🏡 index : github.com/captn3m0/mf.captnemo.in.git

author Nemo <commits@captnemo.in> 2023-04-03 13:42:16.0 +05:30:00
committer Nemo <commits@captnemo.in> 2023-04-03 14:03:15.0 +05:30:00
commit
c99ebcb0e3bd857d1ad157d65da85b5789e5c9df [patch]
tree
b52a37cbdaae8f9c3a820d13c53518781bc6a480
parent
5d274d727ffbf2ed21fc9eb66dcabe02ecf12ee6
download
c99ebcb0e3bd857d1ad157d65da85b5789e5c9df.tar.gz

[ci] Run builds on GitHub Actions

This avoids Netlify Build limits

Diff

 README.md                          |  4 ++++
 .github/workflows/daily-deploy.yml | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+)

diff --git a/README.md b/README.md
index ab63b7f..9051aa0 100644
--- a/README.md
+++ a/README.md
@@ -25,6 +25,10 @@
- NAV data from AMFI is updated daily and published as a SQLite Database by https://github.com/captn3m0/historical-mf-data.
- This website takes the above, and publishes it via Netlify.

## update

Updates to the dataset are published daily around 2330 IST, and the site is deployed again around 0230 IST.

## license

Licensed under the [MIT License](https://nemo.mit-license.org/). See [`LICENSE`](https://github.com/captn3m0/mf.captnemo.in/tree/main/LICENSE) file for details.
diff --git a/.github/workflows/daily-deploy.yml b/.github/workflows/daily-deploy.yml
new file mode 100644
index 0000000..4d674a1 100644
--- /dev/null
+++ a/.github/workflows/daily-deploy.yml
@@ -1,0 +1,32 @@
name: Update Data
on:
  schedule:
    # This runs at 10PM UTC
    # = 02:30 IST
    - cron: '0 22 * * *'
jobs:
  update:
    name: Daily Deploy
    runs-on: ubuntu-latest
    steps:
    - name: Download Historical Mutual Funds Data
      run: |

        wget https://github.com/captn3m0/historical-mf-data/releases/latest/download/funds.db.zst
        unzstd funds.db.zst
        echo 'CREATE INDEX "date" ON "nav" ("date","scheme_code")' | sqlite3 funds.db
        echo 'CREATE INDEX "nav-scheme" ON "nav" ("scheme_code")' | sqlite3 funds.db
        echo 'CREATE INDEX "securities-scheme" ON "securities" ("scheme_code")' | sqlite3 funds.db
        echo 'CREATE INDEX "securities-isin" ON "securities" ("isin")' | sqlite3 funds.db
    - name: Build Website
      run: |

        bundle install
        bundle exec jekyll build
    - name: 'Deploy to Netlify'
      uses: jsmrcaga/action-netlify-deploy@v2.0.0
      with:
        NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
        NETLIFY_DEPLOY_TO_PROD: true
        NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
        build_directory: _site
        install_command: "echo 'Skipping install command'"
        build_command: "echo 'Skipping build command'"