packages: init #417
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "pages" | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| actions: read | |
| contents: read | |
| pages: write | |
| id-token: write | |
| deployments: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| name: Build search | |
| if: github.repository_owner == 'NuschtOS' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| #- name: Make some space | |
| # # TODO: switch back to a release, when https://github.com/wimpysworld/nothing-but-nix/pull/25 is in one | |
| # uses: wimpysworld/nothing-but-nix@main | |
| - name: Set Swap Space | |
| uses: pierotofy/set-swap-space@master | |
| with: | |
| swap-size-gb: 20 | |
| - name: Install Nix | |
| uses: cachix/install-nix-action@v31 | |
| - uses: DeterminateSystems/magic-nix-cache-action@v13 | |
| - name: Build search | |
| # reduce max jobs to not run out of memory | |
| run: | | |
| nix build -j 1 -L \ | |
| github:NuschtOS/search.nuschtos.de/packages \ | |
| --override-input search . \ | |
| --override-input nixpkgs $(jq -r '"github:" + .nodes.nixpkgs.locked.owner + "/" + .nodes.nixpkgs.locked.repo + "/" + .nodes.nixpkgs.locked.rev' flake.lock) | |
| - uses: nicknovitski/nix-develop@v1 | |
| # prevent the wrangler action from installing all npm packages again... | |
| - run: rm package.json pnpm-lock.yaml | |
| - name: Publish to Cloudflare Pages | |
| if: "github.repository_owner == 'NuschtOS'" | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: 2a09613716e511a8fe8ca74abc084762 | |
| command: pages deploy result --project-name=nuschtos-search | |
| gitHubToken: ${{ github.token }} | |
| packageManager: pnpm |