Skip to content

Conversation

@dir01
Copy link

@dir01 dir01 commented Jul 21, 2025

Addresses #185

Sample run can be found at
https://github.com/dir01/sqlite-web/actions/runs/16426825187/job/46419088554

Please let me know if you are in general satisfied with this approach and I'm going to test stuff like "does the cache work" and "does it work as expected when we create a new tag"

@coleifer
Copy link
Owner

Nice, what all did you need to set up in the action environment or settings? I am practically illiterate about all this stuff. I think I have the current image building set-up to do a separate release for "latest" (current commit) and whenever there is a release tag -- do you know how that will work if it builds on every push? Thanks for putting in the effort on this, I know it will make people happy to see it merged.

@dir01
Copy link
Author

dir01 commented Jul 22, 2025

Thanks for the project, it's exactly what I was looking for

I had to issue a new token (Settings -> Developer Settings -> Personal Access Tokens -> Generate New Token (Classic) -> [v] write:package) and then set it up in (Repo Settings -> Secrets and Variables -> Actions -> Repository Secrets -> New Repository Secret -> [use "GHCR_TOKEN" as key]

In your current setup, however, everything seems to be working just fine with default GITHUB_TOKEN, so I would first try to rename GHCR_TOKEN to GITHUB_TOKEN and see if it does the trick. For me it does not for some reason, for you it apparently does, so 🤷


There is another issue, both with my proposed solution and with your current setup

I've inspected the dockerfile, and it contains no dependencies on the contents of this repository, which means two things, as far as I understand:

  1. In your current setup, no matter what triggered the build: push to master or a new tag - the resulting image will change only if you published a new version to PyPI (This line: pip install --no-cache-dir flask peewee sqlite-web is executed while the image is built and whatever arrived from pip at that moment is what we'll have in the resulting image). So no matter what you push to master, image tagged latest would always contain https://pypi.org/project/sqlite-web/0.6.4/

  2. With this PR, we'll never see a new image at all since it utilizes cache and there is nothing that can change in this repository that will invalidate this cache since nothing is ADDed or COPYed inside the image

There are different possible solutions:

  • Build images from the code; Also publish to PyPI from GitHub Actions so that Docker version matches PyPI version
  • Only build fresh pushes to master in GitHub Actions and tag them as master, but also use code from the repo (otherwise we publish as latest whatever the last version published to PyPI)
  • If you publish to PyPI with some script, just build images locally and publish them from the same script
  • etc

I don't know your workflow so I can't suggest what solution would work best for your needs

@coleifer
Copy link
Owner

I've inspected the dockerfile, and it contains no dependencies on the contents of this repository

Oh, right -- yes, this was when the Dockerfile was intended as a standalone thing just to help people get up and running quickly. Probably want to modify the Dockerfile so it builds from the local code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants