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

Nix time #143

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .dockerignore
Copy link

Choose a reason for hiding this comment

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

where it go??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

deleted

This file was deleted.

27 changes: 15 additions & 12 deletions .github/workflows/publish-docker-image.yml
Copy link

Choose a reason for hiding this comment

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

i don't like this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why not? 😃

Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,22 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
- name: Install nix
uses: cachix/install-nix-action@v27
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
extra_nix_config: |
trusted-public-keys = pingu.cachix.org-1:42+JuilNrMORsv7pUKCrpzAB5ykq1Y7XVEf+Wl8TVFg=
substituters-extra = https://pingu.cachix.org

- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v5
- run: nix build .\#docker
- run: docker load < ./result

- name: Push To quay.io
id: push-to-quay
uses: redhat-actions/push-to-registry@v2
with:
context: .
push: true
image: mat-chalmers
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
registry: ${{ env.REGISTRY }}
username: ${{ secrets.GITHUB_TOKEN }}
password: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ cabal.sandbox.config
dist-newstyle/
result/
logs/
result
18 changes: 0 additions & 18 deletions Dockerfile
Copy link

Choose a reason for hiding this comment

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

docker? 🥺

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We got docker at home

This file was deleted.

2 changes: 1 addition & 1 deletion docker-compose.yml
The1Penguin marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
mat:
build: .
image: mat-chalmers:latest
restart: unless-stopped
ports:
- "5007:5007"
9 changes: 9 additions & 0 deletions flake.nix
Copy link

Choose a reason for hiding this comment

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

don't get this, plz explan?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, so ponder the following

What if your package manager, could build the entire docker image by itself, and handle the dependencies.
This does that, and a bit more ;P

Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@
packages = rec {
default = mat;
mat = pkgs.haskell.packages.${ghcVer}.mat;
docker = pkgs.dockerTools.buildLayeredImage {
name = "mat-chalmers";
tag = "latest";
contents = with pkgs; [ cacert glibcLocalesUtf8 ];
config = {
Cmd = "${mat}/bin/mat-chalmers";
Env = [ "LANG=C.UTF-8" ];
};
};
};

checks = {
Expand Down
Loading