merge queue: embarking main (b66c2ae), #1427 and #1428 together #5903
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: "build" | |
| on: | |
| push: | |
| pull_request_target: | |
| branches: ["main"] | |
| env: | |
| cloudflare_project: noogle | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: cachix/install-nix-action@v31 | |
| with: | |
| nix_path: nixpkgs=channel:nixos-unstable | |
| - uses: cachix/cachix-action@v16 | |
| with: | |
| name: nix-community | |
| authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" | |
| # Since ubuntu 22.30, unprivileged usernamespaces are no longer allowed to map to the root user: | |
| # https://ubuntu.com/blog/ubuntu-23-10-restricted-unprivileged-user-namespaces | |
| # This is a workaround needed to build nix itself in github actions | |
| - run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 | |
| - run: nix build .#ui -L | |
| - name: Publish to Cloudflare Pages | |
| if: github.event_name == 'push' | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| command: pages deploy ./result --project-name=${{ env.cloudflare_project }} | |
| - name: Publish to Cloudflare Pages | |
| id: publish | |
| if: github.event_name == 'pull_request_target' | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| command: pages deploy ./result --project-name=noogle --branch=pr-${{ github.event.pull_request.number }} | |
| - uses: peter-evans/create-or-update-comment@v3 | |
| if: github.event_name == 'pull_request_target' | |
| with: | |
| issue-number: ${{ github.event.pull_request.number }} | |
| body: | | |
| <!-- DEPLOYMENT_COMMENT --> | |
| <table><tr><td><strong>Latest commit:</strong> </td><td> | |
| <code>${{ github.event.pull_request.head.sha }}</code> | |
| </td></tr> | |
| <tr><td><strong>Preview URL:</strong></td><td> | |
| <a href='${{ steps.publish.outputs.deployment-url }}'>${{ steps.publish.outputs.deployment-url }}</a> | |
| </td></tr> | |
| <tr><td><strong>Branch Preview URL:</strong></td><td> | |
| <a href='https://pr-${{ github.event.pull_request.number }}.${{ env.cloudflare_project }}.pages.dev'>https://pr-${{ github.event.pull_request.number }}.${{ env.cloudflare_project }}.pages.dev</a> | |
| </td></tr> | |
| </table> | |
| edit-mode: replace |