Skip to content

Commit

Permalink
Added github workflow for building docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
bwbush committed Dec 20, 2024
1 parent 18ef991 commit 8f44b08
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 20 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Docker
env:
ALLOWED_URIS: "https://github.com https://api.github.com"
TRUSTED_PUBLIC_KEYS: "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= thelio:KyHAYh2EtAT5skKWlArHRcLhiq3d13u0Pt9BwDJp7UY="
SUBSTITUTERS: "https://cache.nixos.org/ https://cache.iog.io http://thelio.functionally.dev:5000"
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

on:
pull_request:
push:
branches:
- main
jobs:
typecheck:
name: Build docker image
runs-on: ubuntu-latest
steps:

- name: 📥 Checkout repository
uses: actions/checkout@v4

- name: 🛠️ Install Nix
uses: cachix/install-nix-action@v21
with:
nix_path: nixpkgs=channel:nixos-unstable
install_url: https://releases.nixos.org/nix/nix-2.10.3/install
extra_nix_config: |
allowed-uris = ${{ env.ALLOWED_URIS }}
trusted-public-keys = ${{ env.TRUSTED_PUBLIC_KEYS }}
substituters = ${{ env.SUBSTITUTERS }}
experimental-features = nix-command flakes
accept-flake-config = true
- name: 🏗️ Build image
run: |
nix build -o deltaq-jupyter-docker.tar.gz .#docker
- name: 🔑 Log in to GHCR
run: echo "${{ secrets.GHCR_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: 📦 Push image to GHCR
run: |
SRC=$(docker load -qi deltaq-jupyter-docker.tar.gz | sed -e 's/^Loaded image: //')
DST=ghcr.io/${{ github.repository }}:latest
docker tag $SRC $DST
docker push $DST
2 changes: 1 addition & 1 deletion ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ docker run --publish 9999:8888 localhost/jupyter-deltaq:2mf9zcagms0isg5n94xsml34
or from DockerHub,

```bash
docker run --publish 9999:8888 docker.io/bwbush/jupyter-deltaq:latest
docker run --publish 9999:8888 ghcr.io/functionally/dq-revamp-jupyter:latest
```

The default password is `deltaq`: you can change this by visiting http://localhost:9999/lab in a web browser. Alternatively, you can use with the default password by visiting http://localhost:9999/lab?token=deltaq.
Expand Down
14 changes: 0 additions & 14 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
flake-compat.url = "github:edolstra/flake-compat";
flake-compat.flake = false;
jupyenv.url = "github:tweag/jupyenv?ref=0c86802aaa3ffd3e48c6f0e7403031c9168a8be2";
dq-revamp = {
url = "path:/extra/iohk/dq-revamp";
flake = false;
};
dq-revamp.url = "github:DeltaQ-SD/dq-revamp";
dq-revamp.flake = false;
};

outputs = {
Expand All @@ -29,7 +27,7 @@
dq-revamp,
...
} @ inputs:
flake-utils.lib.eachSystem [ flake-utils.lib.system.x86_64-linux ]
flake-utils.lib.eachSystem (with flake-utils.lib.system; [ x86_64-linux ])
(
system: let

Expand Down

0 comments on commit 8f44b08

Please sign in to comment.