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

Dockerfile + GitHub actions refactor #110

Merged
merged 6 commits into from
Dec 13, 2021
Merged

Dockerfile + GitHub actions refactor #110

merged 6 commits into from
Dec 13, 2021

Conversation

kukovecz
Copy link
Contributor

@kukovecz kukovecz commented Dec 9, 2021

This pull request fixes #36 by adding a Dockerfile (also doing a bigger refactoring on the whole GitHub action workflow chain).

@kukovecz kukovecz marked this pull request as draft December 10, 2021 09:10
@kukovecz kukovecz force-pushed the dockerfile branch 4 times, most recently from d327e45 to 5c510fe Compare December 10, 2021 09:54
@kukovecz kukovecz marked this pull request as ready for review December 10, 2021 09:58
@kukovecz kukovecz force-pushed the dockerfile branch 4 times, most recently from 7c7e0f0 to bd4c5d5 Compare December 10, 2021 12:50
README.md Outdated Show resolved Hide resolved
Dockerfile Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
.github/workflows/main.yml Outdated Show resolved Hide resolved
.github/workflows/main.yml Outdated Show resolved Hide resolved
.github/actions/setup_dependencies/action.yml Outdated Show resolved Hide resolved
.github/actions/setup_dependencies/action.yml Outdated Show resolved Hide resolved
@kukovecz kukovecz force-pushed the dockerfile branch 10 times, most recently from a4869f9 to 8a22166 Compare December 13, 2021 09:53
Setup composite actions - These are a reusable workflow actions (like a function in a
programming language) which helps prepare the targeted environment.

This does every setup things before the actual workflows:
 - Install 3rd party applications with apt
 - Install pip + poetry
 - Install the virtual env with poetry
 - Git LFS pull - with cache

Later this can be extended for other setup activities, or optimize this
by doing caching for the whole virtualenv, etc.

Main workflow - This is the main workflow which runs for every push and
pull requests. It is doing the following jobs (in parallel):
 - check pre-commit
 - check pyright
 - run pytest
We want to cache everything for pip unconditionally, it will solve the
dependencies for itself.
We can build the docker image and push it to the GitHub's container
registry (ghcr.io) with the docker/build-push-action.

Since we are in heavy development, currently this worflow was set up to
run on main branch push events, and publish the container with the latest tag.

Before the actual push, we can build the container locally for testig.
It is using BuildKit, so multiple steps of the docker building are cached
automatically:
https://github.com/docker/build-push-action/blob/master/docs/advanced/test-before-push.md
@kissgyorgy kissgyorgy merged commit 7b2d4ad into main Dec 13, 2021
@kissgyorgy kissgyorgy deleted the dockerfile branch December 13, 2021 15:56
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.

Write Dockerfile
2 participants