Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build and push docker images with Github Actions #47

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

EvanKrall
Copy link

@EvanKrall EvanKrall commented Nov 18, 2022

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

@@ -3,6 +3,7 @@ RUN apk update && apk upgrade && apk add sqlite-static
WORKDIR /build/
ARG version
RUN git clone --branch ${version:-dist} --depth 1 https://github.com/toddsundsted/ktistec .
RUN shards update
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this, I got the error

#13 6.141 Outdated shard.lock (backtracer requirements changed). Please run shards update instead.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same error here as well without running shards update first.

@toddsundsted
Copy link
Owner

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.

@EvanKrall EvanKrall force-pushed the github_actions branch 2 times, most recently from d6e65f7 to bcd4cad Compare November 22, 2022 19:40
@EvanKrall
Copy link
Author

EvanKrall commented Nov 22, 2022

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
Copy link
Author

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.

@zimbatm zimbatm mentioned this pull request Jan 21, 2023
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.

3 participants