Skip to content

Conversation

@bnavetta
Copy link
Collaborator

@bnavetta bnavetta commented Mar 6, 2021

This uses GitHub actions to automatically build Docker images. It uses new caching features so that builds don't have to re-fetch all our dependencies each time. It also automatically pushes to GitHub's Docker image registry, so we can download and run images from there.

The build will run on every commit to master, and can also be triggered manually from GitHub.

Testing

I built and started the images locally, with a few small changes, to make sure the caching worked. I'm not sure how to test the GitHub Actions part until it's merged, however.

@bnavetta bnavetta requested review from jtc2 and paddonizio March 6, 2021 23:27
--mount=type=cache,target=/app/target \
cargo install --path .

FROM debian:buster-slim
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should be a bit smaller than the ubuntu base image

COPY . /app
WORKDIR /app

RUN --mount=type=cache,target=/usr/local/cargo/registry \
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because of how Docker's caching implementation works, we have to copy any build results out of the directory that's mounted as a cache

username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
repository: theadd336/THavalonWeb/thavalon-server
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

🤞 this should work. I'm not entirely sure how the GitHub Packages setup works

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