Giter VIP home page Giter VIP logo

Comments (6)

simonw avatar simonw commented on May 21, 2024

So I need somewhere else to keep that .db file in between runs.

A few options:

That last option is tempting but feels a bit rude - that's going to end up being an enormous .git history. Though I guess I could flatten the history every time I store a file there...

from til.

simonw avatar simonw commented on May 21, 2024

I'm going to try doing this with artifacts first, mainly to learn how to use them.

from til.

simonw avatar simonw commented on May 21, 2024

Not sure that will work:

Note: You can only download artifacts in a workflow that were uploaded during the same workflow run.

from til.

simonw avatar simonw commented on May 21, 2024

I could also migrate the site to Google Cloud Run.

from til.

simonw avatar simonw commented on May 21, 2024

Got this working! The latest til.db file is now stored in https://github.com/simonw/til-db - every time I push a new copy of the file there I use git commit --amend to rewrite history followed by git push --force - so that repo only ever contains a single commit which is the commit that added the file.

- name: Checkout til-db
uses: actions/checkout@v2
with:
repository: simonw/til-db
path: til-db
token: ${{ secrets.PERSONAL_ACCESS_TOKEN_FOR_PUSH }}

Then later:

- name: Save til.db to simonw/til-db
run: |-
cd til-db
cp ../main/til.db .
git add til.db
git commit --amend --no-edit
git push --force

from til.

cbeauhilton avatar cbeauhilton commented on May 21, 2024

I was using a slightly modified version of this solution with great joy for a while, but eventually ran into a couple of issues. The main one is that the sqlite file outgrew its britches, even without tracking its history.

I ended up using GitHub Releases instead, which has a 2GB single file limit.

See my workflow file here.

The overall architecture is now three repos: one for code, one for flat files, and one for the db. I could probably get rid of the db repo and include the sqlite file as a release in either of the other repos as well.

Cheers, and thanks for all the inspiration. Happy to take any suggestions as well.

P.S. Using a separate repo for flat files (JSON, here) yields a bit of a free, hosted NoSQL backend. I think it's a fun pattern.

from til.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.