ktistec icon indicating copy to clipboard operation
ktistec copied to clipboard

Build and push docker images with Github Actions

Open EvanKrall opened this issue 2 years ago • 3 comments

This will have Github Actions build and push docker images to toddsundsted/ktistec:latest every time you update the main branch. If you'd like, I can make it push tags to toddsundsted/ktistec:<tagname> instead / in addition.

To make this work, you'll have to:

  1. create a docker hub token by going to https://hub.docker.com/settings/security
  2. create DOCKERHUB_USERNAME and DOCKERHUB_TOKEN secrets at https://github.com/toddsundsted/ktistec/settings/secrets/actions

EvanKrall avatar Nov 18 '22 03:11 EvanKrall

thanks! this is great! i'm reviewing it now.

the only hold up is "shards update". i'd like dependencies to be fixed in a release—shards update changes them. it looks like, however, something happened to the backtracer shard. i'd like to address that specifically, if possible, rather just work around it with an update.

toddsundsted avatar Nov 20 '22 14:11 toddsundsted

I've removed the shards update from this branch, and also made it so it pushes to ${{ secrets.DOCKERHUB_USERNAME }}/ktistec instead of hard-coding toddsundsted/ktistec, so that forks can push to their own docker hub namespace.

EvanKrall avatar Nov 22 '22 19:11 EvanKrall

I'm realizing that my latest built docker image still doesn't have the latest code (so I'm still hitting #21), because the Dockerfile clones the dist branch (which hasn't been updated with the fix for #21.)

RUN git clone --branch ${version:-dist} --depth 1 https://github.com/toddsundsted/ktistec .

It seems to me like it would be more idiomatic to use ADD . /build/ and RUN npm run build. This would ensure that the docker image produced always reflects the version of the code that's used to build it.

EvanKrall avatar Nov 22 '22 23:11 EvanKrall