name: Nix build and commit on: pull_request: types: [opened, synchronize, reopened] workflow_dispatch: permissions: contents: write jobs: build_and_commit: runs-on: docker-builder-01 steps: - name: Show disk usage run: df -h - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 0 lfs: true ref: ${{ github.head_ref || github.ref }} - name: Install Nix uses: cachix/install-nix-action@v31 - name: Setup huggingface cachix uses: cachix/cachix-action@v15 with: name: huggingface - name: Clean build directory run: | rm -rf build - name: Build with Nix run: | nix run .#build-and-copy \ --override-input kernel-builder github:huggingface/kernel-builder \ --max-jobs 8 \ -j 8 \ -L - name: List built binaries run: | ls build - name: Commit build artifact run: | git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git add build/* git commit -m "Add built binary [ci skip]" - name: Push changes run: | git push origin HEAD:"$HEAD_REF" env: HEAD_REF: ${{ github.head_ref || github.ref }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}