|
1 |
| -name: 'build' |
| 1 | +name: build |
| 2 | + |
2 | 3 | on:
|
3 | 4 | pull_request:
|
4 | 5 | push:
|
| 6 | + |
5 | 7 | jobs:
|
6 | 8 | build:
|
7 | 9 | runs-on: ubuntu-latest
|
| 10 | + timeout-minutes: 30 |
| 11 | + |
8 | 12 | steps:
|
9 |
| - - name: 'Checkout codebase' |
10 |
| - if: github.event_name == 'push' |
11 |
| - uses: actions/checkout@v2.4.0 |
| 13 | + - name: Checkout (push/merge) |
| 14 | + if: ${{ github.event_name != 'pull_request' }} |
| 15 | + uses: actions/checkout@v5 |
12 | 16 | with:
|
13 | 17 | fetch-depth: 0
|
14 | 18 |
|
15 |
| - - name: 'Checkout codebase' |
16 |
| - if: github.event_name == 'pull_request' |
17 |
| - uses: actions/checkout@v2.4.0 |
| 19 | + - name: Checkout (PR head) |
| 20 | + if: ${{ github.event_name == 'pull_request' }} |
| 21 | + uses: actions/checkout@v5 |
18 | 22 | with:
|
19 | 23 | fetch-depth: 0
|
20 | 24 | ref: ${{ github.event.pull_request.head.sha }}
|
21 | 25 |
|
22 |
| - - uses: cachix/install-nix-action@v14 |
23 |
| - - run: NIXPKGS_ALLOW_UNFREE=1 nix --experimental-features 'nix-command flakes' build -L --impure |
24 |
| - - name: 'Copy book' |
25 |
| - run: cp result/share/book.pdf . |
26 |
| - - name: 'Upload artifact to GitHub' |
27 |
| - |
| 26 | + - name: Install Nix |
| 27 | + uses: cachix/install-nix-action@v31 |
| 28 | + |
| 29 | + - name: Build (Nix flake) |
| 30 | + run: nix build -L --impure |
| 31 | + env: |
| 32 | + NIXPKGS_ALLOW_UNFREE: 1 |
| 33 | + |
| 34 | + - name: Copy book |
| 35 | + run: cp result/share/book.pdf ./book.pdf |
| 36 | + |
| 37 | + - name: Upload artifact |
| 38 | + uses: actions/upload-artifact@v4 |
28 | 39 | with:
|
29 | 40 | name: book.pdf
|
30 | 41 | path: book.pdf
|
| 42 | + if-no-files-found: error |
| 43 | + retention-days: 90 |
0 commit comments