packages: init #338
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 | |
| # NOTE: not using the nix-daemon causes different hashes in FOD | |
| # - name: Install Nix | |
| # uses: nixbuild/nix-quick-install-action@v30 | |
| # | |
| # - uses: nix-community/cache-nix-action@v6 | |
| # with: | |
| # primary-key: nix-${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('**/*.nix', '**/flake.lock') }} | |
| # restore-prefixes-first-match: nix-${{ runner.os }}-${{ matrix.target }}- | |
| - 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 2 -L \ | |
| github:NuschtOS/search.nuschtos.de/packages \ | |
| --override-input search . \ | |
| --override-input nixpkgs github:NuschtOS/nuschtpkgs/nixos-unstable | |
| - uses: nicknovitski/nix-develop@v1 | |
| - name: Copy fixx | |
| run: | | |
| nix build .#fixx-dist | |
| cp --no-preserve=all ./result-dist/nuschtos-fixx-*-git.tgz . | |
| pnpm i ./nuschtos-fixx-*-git.tgz | |
| ./nix/update-pnpm-hash.sh | |
| - 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 |