Skip to content

Commit 498438c

Browse files
authored
Merge pull request #157 from siraben/gh-actions
Update and modernize GitHub actions
2 parents 2460ef4 + abba72e commit 498438c

File tree

2 files changed

+53
-22
lines changed

2 files changed

+53
-22
lines changed

.github/workflows/build.yml

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,43 @@
1-
name: 'build'
1+
name: build
2+
23
on:
34
pull_request:
45
push:
6+
57
jobs:
68
build:
79
runs-on: ubuntu-latest
10+
timeout-minutes: 30
11+
812
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
1216
with:
1317
fetch-depth: 0
1418

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
1822
with:
1923
fetch-depth: 0
2024
ref: ${{ github.event.pull_request.head.sha }}
2125

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-
uses: actions/[email protected]
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
2839
with:
2940
name: book.pdf
3041
path: book.pdf
42+
if-no-files-found: error
43+
retention-days: 90

flake.lock

Lines changed: 27 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)