diff --git a/.github/workflows/nix-cache.yml b/.github/workflows/nix-cache.yml new file mode 100644 index 000000000..54f2e12e7 --- /dev/null +++ b/.github/workflows/nix-cache.yml @@ -0,0 +1,71 @@ +name: Nix Cache + +on: + workflow_dispatch: + push: + # Only build nix cache for branches that need distribution + branches: [ "staging", "testnet-internal", "o/nix-ci" ] + +env: + CARGO_TERM_COLOR: always + +jobs: + # build & cache project dependencies + deps: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v25 + - uses: cachix/cachix-action@v14 + with: + name: fleek-network + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - run: nix build .#lightning-deps + + # build & cache node binary + node: + runs-on: ubuntu-latest + needs: deps + steps: + - name: Clean runner image + run: | + # Free up some space, we only need nix anyways + df -h + sudo rm -rf \ + "$AGENT_TOOLSDIRECTORY" \ + /usr/local/share/boost \ + /usr/share/dotnet \ + /opt/ghc + echo "After removing files:" + df -h + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v25 + - uses: cachix/cachix-action@v14 + with: + name: fleek-network + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - run: nix build .#lightning-node + + # build & cache services binaries + services: + runs-on: ubuntu-latest + needs: deps + steps: + - name: Clean runner image + run: | + # Free up some space, we only need nix anyways + df -h + sudo rm -rf \ + "$AGENT_TOOLSDIRECTORY" \ + /usr/local/share/boost \ + /usr/share/dotnet \ + /opt/ghc + echo "After removing files:" + df -h + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v25 + - uses: cachix/cachix-action@v14 + with: + name: fleek-network + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - run: nix build .#lightning-services