selfhostable, read-only reddit client
16
fork

Configure Feed

Select the types of activity you want to include in your feed.

add docker image output to flake, build on ci

Akshay 2b5b2c19 cd1b7d0b

+62 -4
+35
.github/workflows/publish-docker.yml
··· 1 + name: pubish docker image 2 + 3 + on: 4 + push: 5 + branches: 6 + - master 7 + 8 + jobs: 9 + build-and-publish: 10 + runs-on: ubuntu-latest 11 + 12 + steps: 13 + - name: checkout repository 14 + uses: actions/checkout@v4 15 + 16 + - name: install nix 17 + uses: cachix/install-nix-action@v27 18 + with: 19 + github_access_token: ${{ secrets.GITHUB_TOKEN }} 20 + 21 + - name: build docker image 22 + run: nix build -L .#dockerImage 23 + 24 + - name: log in to github container registry 25 + uses: docker/login-action@v3 26 + with: 27 + registry: ghcr.io 28 + username: ${{ github.actor }} 29 + password: ${{ secrets.GITHUB_TOKEN }} 30 + 31 + - name: publish docker image 32 + run: | 33 + docker load < result 34 + docker tag lurker:latest ghcr.io/${{ github.repository_owner }}/lurker:latest 35 + docker push ghcr.io/${{ github.repository_owner }}/lurker:latest
+27 -4
flake.nix
··· 17 17 ]; 18 18 }); 19 19 in { 20 - overlays.default = final: prev: { 20 + overlays.default = final: prev: let 21 + pname = "lurker"; 22 + version = "0.1.0"; 23 + in { 21 24 node_modules = with final; 22 25 stdenv.mkDerivation { 23 26 pname = "lurker-node-modules"; ··· 44 47 }; 45 48 lurker = with final; 46 49 stdenv.mkDerivation { 47 - pname = "lurker"; 48 - version = "0.0.1"; 50 + inherit pname version; 49 51 src = ./.; 50 52 nativeBuildInputs = [makeBinaryWrapper]; 51 53 buildInputs = [bun]; ··· 71 73 72 74 ''; 73 75 }; 76 + dockerImage = with final; 77 + final.dockerTools.buildImage { 78 + name = pname; 79 + tag = "latest"; 80 + 81 + copyToRoot = final.buildEnv { 82 + name = "image-root"; 83 + paths = [ final.lurker ]; 84 + pathsToLink = [ "/bin" ]; 85 + }; 86 + 87 + runAsRoot = '' 88 + mkdir -p /data 89 + ''; 90 + 91 + config = { 92 + Cmd = ["/bin/${pname}"]; 93 + WorkingDir = "/data"; 94 + Volumes = {"/data" = {};}; 95 + }; 96 + }; 74 97 }; 75 98 76 99 devShell = forAllSystems (system: let ··· 84 107 }); 85 108 86 109 packages = forAllSystems (system: { 87 - inherit (nixpkgsFor."${system}") lurker node_modules; 110 + inherit (nixpkgsFor."${system}") lurker node_modules dockerImage; 88 111 }); 89 112 90 113 defaultPackage = forAllSystems (system: nixpkgsFor."${system}".lurker);